Home / Function/ doWriteInternal() — netty Function Reference

doWriteInternal() — netty Function Reference

Architecture documentation for the doWriteInternal() function in AbstractNioByteChannel.java from the netty codebase.

Function java Buffer Search calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  e280c816_366c_4e91_6697_7eba37a14c24["doWriteInternal()"]
  81dd42bf_4dab_740c_6405_14423e9ad1f8["AbstractNioByteChannel"]
  e280c816_366c_4e91_6697_7eba37a14c24 -->|defined in| 81dd42bf_4dab_740c_6405_14423e9ad1f8
  254496f6_25fc_84de_730e_8f3b0842a4b3["doWrite0()"]
  254496f6_25fc_84de_730e_8f3b0842a4b3 -->|calls| e280c816_366c_4e91_6697_7eba37a14c24
  a28491f1_6177_d155_eb85_0f25c627fb66["doWrite()"]
  a28491f1_6177_d155_eb85_0f25c627fb66 -->|calls| e280c816_366c_4e91_6697_7eba37a14c24
  d979b281_e554_0a36_ee1a_a5f247072622["doWriteBytes()"]
  e280c816_366c_4e91_6697_7eba37a14c24 -->|calls| d979b281_e554_0a36_ee1a_a5f247072622
  b3b8d9c2_3c76_2c11_ed36_bff10b5cdd5f["doWriteFileRegion()"]
  e280c816_366c_4e91_6697_7eba37a14c24 -->|calls| b3b8d9c2_3c76_2c11_ed36_bff10b5cdd5f
  style e280c816_366c_4e91_6697_7eba37a14c24 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/nio/AbstractNioByteChannel.java lines 225–261

    private int doWriteInternal(ChannelOutboundBuffer in, Object msg) throws Exception {
        if (msg instanceof ByteBuf) {
            ByteBuf buf = (ByteBuf) msg;
            if (!buf.isReadable()) {
                in.remove();
                return 0;
            }

            final int localFlushedAmount = doWriteBytes(buf);
            if (localFlushedAmount > 0) {
                in.progress(localFlushedAmount);
                if (!buf.isReadable()) {
                    in.remove();
                }
                return 1;
            }
        } else if (msg instanceof FileRegion) {
            FileRegion region = (FileRegion) msg;
            if (region.transferred() >= region.count()) {
                in.remove();
                return 0;
            }

            long localFlushedAmount = doWriteFileRegion(region);
            if (localFlushedAmount > 0) {
                in.progress(localFlushedAmount);
                if (region.transferred() >= region.count()) {
                    in.remove();
                }
                return 1;
            }
        } else {
            // Should not reach here.
            throw new Error("Unexpected message type: " + className(msg));
        }
        return WRITE_STATUS_SNDBUF_FULL;
    }

Domain

Subdomains

Frequently Asked Questions

What does doWriteInternal() do?
doWriteInternal() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/nio/AbstractNioByteChannel.java.
Where is doWriteInternal() defined?
doWriteInternal() is defined in transport/src/main/java/io/netty/channel/nio/AbstractNioByteChannel.java at line 225.
What does doWriteInternal() call?
doWriteInternal() calls 2 function(s): doWriteBytes, doWriteFileRegion.
What calls doWriteInternal()?
doWriteInternal() is called by 2 function(s): doWrite, doWrite0.

Analyze Your Own Codebase

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

Try Supermodel Free