Home / Function/ bytesBeforeWritable() — netty Function Reference

bytesBeforeWritable() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java lines 782–789

    public long bytesBeforeWritable() {
        // +1 because writability doesn't change until the threshold is crossed (not equal to).
        long bytes = totalPendingSize - channel.config().getWriteBufferLowWaterMark() + 1;
        // If bytes is negative we know we are 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() ? 0 : bytes;
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does bytesBeforeWritable() do?
bytesBeforeWritable() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java.
Where is bytesBeforeWritable() defined?
bytesBeforeWritable() is defined in transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java at line 782.
What does bytesBeforeWritable() call?
bytesBeforeWritable() 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