@Override
        public int read(@NotNull final byte[] b, final int off, final int tryLen) throws IOException {
            // Make sure we don't max
            final long maxSize = getCurrentBlockRawGzipSize();
            int realLen = tryLen;
            if (tryLen + bytesRead > maxSize) {
                // Trim the length
                realLen = (int) (maxSize - bytesRead);
                // Nothing more to read
                if (realLen == 0) {
                    return -1;
                }
            }
            // Do the read
            final int realBytesRead = getCurrentRawStreamBuffer().read(b, off, realLen);
            // We may end up reading a smaller amount
            bytesRead += realBytesRead;
            return realBytesRead;
        }
Adaptor to create a stream over the raw buffer and ensures that we don't
read more than we are allowed to (for the gzip stream)
stroom-data/stroom-data-store-impl-fs/src/main/java/stroom/data/store/impl/fs/BlockGZIPInput.java