public ByteBuffer getByteBuffer() {
        isAvailableForWriting = false;
        final PooledByteBuffer pooledByteBuffer = getCurrentPooledBuffer();
        final ByteBuffer byteBuffer = pooledByteBuffer.getByteBuffer();
        byteBuffer.flip();
        return byteBuffer;
    }
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