@Override
    public void write(@NotNull final byte[] bytes, final int offset, final int length) throws IOException {
        if (currentStreamBuffer == null) {
            startGzipBlock();
        }

        // Find out how many bytes are left to write in the current block
        int bytesLeftInBlock = (int) (currentBlockEndPos - position);

        // These bytes will fit in this block
        if (length <= bytesLeftInBlock) {
            currentStreamBuffer.write(bytes, offset, length);
            position += length;

            if (length == bytesLeftInBlock) {
                endGzipBlock();
            }

        } else {
            // We need to split this up - write the first half
            currentStreamBuffer.write(bytes, offset, bytesLeftInBlock);
            position += bytesLeftInBlock;
            endGzipBlock();
            // Now have ago again with the reminder
            write(bytes, offset + bytesLeftInBlock, length - bytesLeftInBlock);
        }

    }
Start a new burst of GZIP Block Content (with a marker).
stroom-data/stroom-data-store-impl-fs/src/main/java/stroom/data/store/impl/fs/BlockGZIPOutputFile.java