Home / Function/ bytesBeforeUnwritable() — netty Function Reference

bytesBeforeUnwritable() — netty Function Reference

Architecture documentation for the bytesBeforeUnwritable() function in ChannelOutboundBuffer.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  6a4f6feb_53f5_83ad_8ce5_8894597f73d7["bytesBeforeUnwritable()"]
  509b1bc5_7cdc_9ee4_03d9_31eb2203d807["ChannelOutboundBuffer"]
  6a4f6feb_53f5_83ad_8ce5_8894597f73d7 -->|defined in| 509b1bc5_7cdc_9ee4_03d9_31eb2203d807
  df7f3bd3_64cc_5c84_045e_9b26f703405b["isWritable()"]
  6a4f6feb_53f5_83ad_8ce5_8894597f73d7 -->|calls| df7f3bd3_64cc_5c84_045e_9b26f703405b
  style 6a4f6feb_53f5_83ad_8ce5_8894597f73d7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java lines 769–776

    public long bytesBeforeUnwritable() {
        // +1 because writability doesn't change until the threshold is crossed (not equal to).
        long bytes = channel.config().getWriteBufferHighWaterMark() - totalPendingSize + 1;
        // If bytes is negative we know we are not writable, but if bytes is non-negative we have to check writability.
        // Note that totalPendingSize and isWritable() use different volatile variables that are not synchronized
        // together. totalPendingSize will be updated before isWritable().
        return bytes > 0 && isWritable() ? bytes : 0;
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does bytesBeforeUnwritable() do?
bytesBeforeUnwritable() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java.
Where is bytesBeforeUnwritable() defined?
bytesBeforeUnwritable() is defined in transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java at line 769.
What does bytesBeforeUnwritable() call?
bytesBeforeUnwritable() calls 1 function(s): isWritable.

Analyze Your Own Codebase

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

Try Supermodel Free