Home / Function/ onDataRead() — netty Function Reference

onDataRead() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  705b432a_f86e_1860_a699_d7ea944f432f["onDataRead()"]
  aed86996_f518_c45d_5bdf_47241b8bdd57["InboundHttp2ToHttpAdapter"]
  705b432a_f86e_1860_a699_d7ea944f432f -->|defined in| aed86996_f518_c45d_5bdf_47241b8bdd57
  dd41a085_6ba9_3e5b_7096_37e5368a853b["fireChannelRead()"]
  705b432a_f86e_1860_a699_d7ea944f432f -->|calls| dd41a085_6ba9_3e5b_7096_37e5368a853b
  style 705b432a_f86e_1860_a699_d7ea944f432f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java lines 224–248

    @Override
    public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream)
            throws Http2Exception {
        Http2Stream stream = connection.stream(streamId);
        FullHttpMessage msg = getMessage(stream);
        if (msg == null) {
            throw connectionError(PROTOCOL_ERROR, "Data Frame received for unknown stream id %d", streamId);
        }

        ByteBuf content = msg.content();
        final int dataReadableBytes = data.readableBytes();
        if (content.readableBytes() > maxContentLength - dataReadableBytes) {
            throw connectionError(INTERNAL_ERROR,
                    "Content length exceeded max of %d for stream id %d", maxContentLength, streamId);
        }

        content.writeBytes(data, data.readerIndex(), dataReadableBytes);

        if (endOfStream) {
            fireChannelRead(ctx, msg, false, stream);
        }

        // All bytes have been processed.
        return dataReadableBytes + padding;
    }

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/InboundHttp2ToHttpAdapter.java.
Where is onDataRead() defined?
onDataRead() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java at line 224.
What does onDataRead() call?
onDataRead() calls 1 function(s): fireChannelRead.

Analyze Your Own Codebase

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

Try Supermodel Free