public void write(byte[] b, int off, int len) throws IOException {
        if (len > 0) {
            checkWriteableState();
            Objects.checkFromIndexSize(off, len, b.length);
            checkSizeAndGrow(len);

            getCurrentPooledBuffer().getByteBuffer().put(b, off, len);
        }
    }
Gets the current {@link PooledByteBuffer} object. The underlying buffer will be flipped
so that it is ready for reading. No writes should happen to this stream once getPooledByteBuffer
has been called.
stroom-bytebuffer/src/main/java/stroom/bytebuffer/PooledByteBufferOutputStream.java