private PooledByteBuffer getCurrentPooledBuffer() {
        if (pooledByteBuffer == null) {
            pooledByteBuffer = pooledByteBufferSupplier.apply(capacity);
        }
        return pooledByteBuffer;
    }
An output stream using a {@link ByteBuffer} supplied from a {@link ByteBufferPool}.
The underlying buffer will be continuously replaced with a larger buffer in the event
that there is insufficient room for the write() methods. The underlying buffer
is obtained from the pool lazily. Calling close/release or using this in a try with
resources block will ensure that the underlying buffer is returned to the pool.
Once getPooledByteBuffer is called, any calls to write(*) will throw and exception until
clear or release are called.
stroom-bytebuffer/src/main/java/stroom/bytebuffer/PooledByteBufferOutputStream.java