public void writeBuffer(ByteBuffer buffer) throws IOException {
        if (buffer.remaining() < RpcConstants.RPC_MAX_BUFFER_SIZE) {
            write(buffer.array(), buffer.position(), buffer.remaining());
        } else { // append w/o copying bytes
            ByteBuffer dup = buffer.duplicate();
            dup.position(buffer.limit()); // ready for flip
            buffers.add(dup);
        }
    }
Add a buffer to the output without copying, if possible.

@param buffer   the content need to written
inlong-tubemq/tubemq-core/src/main/java/org/apache/inlong/tubemq/corerpc/netty/ByteBufferOutputStream.java