dap4/d4lib/src/main/java/dap4/dap4lib/ChunkInputStream.java
public String
    readError()
            throws IOException
    {
        state = State.ERROR;
        // Read the error body databuffer
        byte[] bytes = new byte[this.chunksize];
        try {
            if(read(bytes, 0, this.chunksize) < this.chunksize)
                throw new ErrorException("Short chunk");
        } catch (IOException ioe) {
            throw new ErrorException(ioe);
        }
        String document = new String(bytes, DapUtil.UTF8);
        return document;
    }
public String
    readError()
            throws IOException
    {
        state = State.ERROR;
        // Read the error body databuffer
        byte[] bytes = new byte[this.chunksize];
        try {
            if(read(bytes, 0, this.chunksize) < this.chunksize)
                throw new ErrorException("Short chunk");
        } catch (IOException ioe) {
            throw new ErrorException(ioe);
        }
        String document = new String(bytes, DapUtil.UTF8);
        return document;
    }
Read an error chunk

@return the error document as a string