Home / Function/ doWriteBytes() — netty Function Reference

doWriteBytes() — netty Function Reference

Architecture documentation for the doWriteBytes() function in AbstractKQueueChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2e074836_1c6a_c77f_f0d8_18600b1b5371["doWriteBytes()"]
  e50a36fb_84e6_15bc_5dc3_edd4246018f8["AbstractKQueueChannel"]
  2e074836_1c6a_c77f_f0d8_18600b1b5371 -->|defined in| e50a36fb_84e6_15bc_5dc3_edd4246018f8
  style 2e074836_1c6a_c77f_f0d8_18600b1b5371 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java lines 299–317

    protected final int doWriteBytes(ChannelOutboundBuffer in, ByteBuf buf) throws Exception {
        if (buf.hasMemoryAddress()) {
            int localFlushedAmount = socket.writeAddress(buf.memoryAddress(), buf.readerIndex(), buf.writerIndex());
            if (localFlushedAmount > 0) {
                in.removeBytes(localFlushedAmount);
                return 1;
            }
        } else {
            final ByteBuffer nioBuf = buf.nioBufferCount() == 1?
                    buf.internalNioBuffer(buf.readerIndex(), buf.readableBytes()) : buf.nioBuffer();
            int localFlushedAmount = socket.write(nioBuf, nioBuf.position(), nioBuf.limit());
            if (localFlushedAmount > 0) {
                nioBuf.position(nioBuf.position() + localFlushedAmount);
                in.removeBytes(localFlushedAmount);
                return 1;
            }
        }
        return WRITE_STATUS_SNDBUF_FULL;
    }

Domain

Subdomains

Frequently Asked Questions

What does doWriteBytes() do?
doWriteBytes() is a function in the netty codebase, defined in transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java.
Where is doWriteBytes() defined?
doWriteBytes() is defined in transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java at line 299.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free