int read = state.file.read(buffer);
ByteBuffer bBuffer = ByteBuffer.wrap(buffer, 0, (int) length); int read = state.file.read(bBuffer);
    private SVNDiffWindow readWindow(FSRepresentationState state, int thisChunk, OutputStream dataBuf) throws SVNException, IOException {        //assertion        if(state.chunkIndex > thisChunk){            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "Fatal error while reading diff windows");            SVNErrorManager.error(err);        }        /* Skip windows to reach the current chunk if we aren't there yet. */        while(state.chunkIndex < thisChunk){            skipDiffWindow(state.file);            state.chunkIndex++;            state.offset = state.file.getFilePointer();            if(state.offset >= state.end){                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Reading one svndiff window read beyond the end of the representation");                SVNErrorManager.error(err);            }        }        /* Read the next window. */        myDiffWindowBuilder.reset(SVNDiffWindowBuilder.OFFSET);        myDiffWindowBuilder.accept(state.file);        SVNDiffWindow window = myDiffWindowBuilder.getDiffWindow();        long length = window.getNewDataLength();        byte[] buffer = new byte[(int)length];        int read = state.file.read(buffer);        if(read < length){            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.SVNDIFF_UNEXPECTED_END, "Unexpected end of svndiff input");            SVNErrorManager.error(err);        }        state.chunkIndex++;        state.offset = state.file.position();        if(state.offset > state.end){            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Reading one svndiff window read beyond the end of the representation");            SVNErrorManager.error(err);        }        dataBuf.write(buffer);        return window;    }