class SingleStreamDiffScriptWriter implements DiffScriptWriter {

    @Override
    public void writeChunk(long chunkStart, int chunkLength) throws IOException {
        Preconditions.checkArgument(chunkStart >= 0);
        Preconditions.checkArgument(chunkLength > 0);
        if (mBufferSize != 0) {
            writeByteBuffer();
        }

        if (mReusableChunk != null && mReusableChunk.getEnd() + 1 == chunkStart) {
            // The new chunk overlaps the old, so combine them into a single byte range.
            mReusableChunk = mReusableChunk.extend(chunkLength);
        } else {
            writeReusableChunk();
            mReusableChunk = new ByteRange(chunkStart, chunkStart + chunkLength - 1);
        }
    }

    public  SingleStreamDiffScriptWriter(OutputStream outputStream, int maxNewByteChunkSize);

}