@Override
    public void close() {
        if (releaseFunc == null) {
            if (byteBuffer != null && byteBuffer.isDirect()) {
                try {
                    ByteBufferSupport.unmap(byteBuffer);
                } catch (Exception e) {
                    LOGGER.error("Error releasing direct byte buffer", e);
                }
            }
            byteBuffer = null;
            byteBufferSupplier = null;
        } else if (byteBuffer != null) {
            releaseFunc.accept(byteBuffer);
            byteBuffer = null;
            byteBufferSupplier = null;
            releaseFunc = null;
        }
    }
Release the underlying {@link ByteBuffer} back to the pool. Once released,
the {@link ByteBuffer} cannot be used any more and you should not retain any
references to it.
stroom-bytebuffer/src/main/java/stroom/bytebuffer/PooledByteBufferImpl.java