@Override
    public void flush() throws IOException {
        flushConsumer.accept(buffer.asReadOnly());
        buffer.clear();
        flushed = true;
    }
An {@link OutputStream} that uses {@link ByteBuf} to accumulate stream data before flushing to the
designated {@link Consumer}.
resteasy/src/main/java/com/linecorp/armeria/internal/common/resteasy/ByteBufferBackedOutputStream.java