public Optional<Integer> getCurrentCapacity() {
        return Optional.ofNullable(pooledByteBuffer)
                .map(PooledByteBuffer::getCapacity);
    }
Clears the underlying buffer if there is one.
stroom-bytebuffer/src/main/java/stroom/bytebuffer/PooledByteBufferOutputStream.java