Home / Function/ discardSomeReadBytes() — netty Function Reference

discardSomeReadBytes() — netty Function Reference

Architecture documentation for the discardSomeReadBytes() function in ByteToMessageDecoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2aa120bb_dbc1_13a7_0bbd_6e8fb49ab322["discardSomeReadBytes()"]
  efe4959f_3296_dbb1_4a4b_76b9d7ccec55["ByteToMessageDecoder"]
  2aa120bb_dbc1_13a7_0bbd_6e8fb49ab322 -->|defined in| efe4959f_3296_dbb1_4a4b_76b9d7ccec55
  a22162a0_4ee0_09dc_f31c_e78971c0c57d["channelRead()"]
  a22162a0_4ee0_09dc_f31c_e78971c0c57d -->|calls| 2aa120bb_dbc1_13a7_0bbd_6e8fb49ab322
  6dc6c900_3a3e_0b9b_82b7_c315a803419b["channelReadComplete()"]
  6dc6c900_3a3e_0b9b_82b7_c315a803419b -->|calls| 2aa120bb_dbc1_13a7_0bbd_6e8fb49ab322
  style 2aa120bb_dbc1_13a7_0bbd_6e8fb49ab322 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-base/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java lines 377–388

    protected final void discardSomeReadBytes() {
        if (cumulation != null && !first && cumulation.refCnt() == 1) {
            // discard some bytes if possible to make more room in the
            // buffer but only if the refCnt == 1  as otherwise the user may have
            // used slice().retain() or duplicate().retain().
            //
            // See:
            // - https://github.com/netty/netty/issues/2327
            // - https://github.com/netty/netty/issues/1764
            cumulation.discardSomeReadBytes();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does discardSomeReadBytes() do?
discardSomeReadBytes() is a function in the netty codebase, defined in codec-base/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java.
Where is discardSomeReadBytes() defined?
discardSomeReadBytes() is defined in codec-base/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java at line 377.
What calls discardSomeReadBytes()?
discardSomeReadBytes() is called by 2 function(s): channelRead, channelReadComplete.

Analyze Your Own Codebase

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

Try Supermodel Free