public void write(final ByteBuffer buffer) {
        if (!isClosed.get()) {
            try {
                channel.write(buffer);
            } catch (IOException e) {
                isClosed.compareAndSet(false, true);
                LOG.error("write buffer Failed.", e);
            }
        }
    }
write ByteBuffer.

@param buffer byte buffer
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-common/src/main/java/org/apache/shenyu/plugin/logging/common/body/BodyWriter.java