Home / Function/ onDataRead() — netty Function Reference

onDataRead() — netty Function Reference

Architecture documentation for the onDataRead() function in Http2FrameCodec.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  c2979b96_390d_7b64_2c99_e3e669d4bbfa["onDataRead()"]
  c7728670_9ef4_3d0d_475d_7c991c96be4c["FrameListener"]
  c2979b96_390d_7b64_2c99_e3e669d4bbfa -->|defined in| c7728670_9ef4_3d0d_475d_7c991c96be4c
  c3697987_0f51_1bd9_b480_661a55bd7f7a["onHttp2Frame()"]
  c2979b96_390d_7b64_2c99_e3e669d4bbfa -->|calls| c3697987_0f51_1bd9_b480_661a55bd7f7a
  dafb708f_d534_42b0_93ed_f04119450f7d["consumeBytes()"]
  c2979b96_390d_7b64_2c99_e3e669d4bbfa -->|calls| dafb708f_d534_42b0_93ed_f04119450f7d
  style c2979b96_390d_7b64_2c99_e3e669d4bbfa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java lines 648–664

        @Override
        public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding,
                              boolean endOfStream) {
            Http2FrameStream stream = requireStream(streamId);
            final Http2DataFrame dataframe;
            try {
                dataframe = new DefaultHttp2DataFrame(data.retain(), endOfStream, padding);
            } catch (IllegalArgumentException e) {
                // Might be thrown in case of invalid padding / length.
                data.release();
                throw e;
            }
            dataframe.stream(stream);
            onHttp2Frame(ctx, dataframe);
            // We return the bytes in consumeBytes() once the stream channel consumed the bytes.
            return 0;
        }

Domain

Subdomains

Frequently Asked Questions

What does onDataRead() do?
onDataRead() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java.
Where is onDataRead() defined?
onDataRead() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java at line 648.
What does onDataRead() call?
onDataRead() calls 2 function(s): consumeBytes, onHttp2Frame.

Analyze Your Own Codebase

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

Try Supermodel Free