@Override
    public void produce(final DataStreamChannel channel) throws IOException {
        final SharedOutputBuffer buffer = bufferRef.get();
        if (buffer != null) {
            buffer.flush(channel);
        }
    }
TODO: to be replaced by core functionality
httpclient5/src/main/java/org/apache/hc/client5/http/impl/compat/ClassicToAsyncRequestProducer.java