Home / Function/ decode() — netty Function Reference

decode() — netty Function Reference

Architecture documentation for the decode() function in Http2ConnectionHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  7a6947b9_edc8_6ed8_f6ad_f257a2519043["decode()"]
  83642a58_aebe_1c6a_ae68_9c2017752662["PrefaceDecoder"]
  7a6947b9_edc8_6ed8_f6ad_f257a2519043 -->|defined in| 83642a58_aebe_1c6a_ae68_9c2017752662
  52c5c05c_e3b5_8aff_b159_87aaed064f8f["readClientPrefaceString()"]
  7a6947b9_edc8_6ed8_f6ad_f257a2519043 -->|calls| 52c5c05c_e3b5_8aff_b159_87aaed064f8f
  c95ea991_3080_fce0_ff9f_9e2917aa74d9["verifyFirstFrameIsSettings()"]
  7a6947b9_edc8_6ed8_f6ad_f257a2519043 -->|calls| c95ea991_3080_fce0_ff9f_9e2917aa74d9
  c019b218_592f_da69_100d_79381ffa0e04["onError()"]
  7a6947b9_edc8_6ed8_f6ad_f257a2519043 -->|calls| c019b218_592f_da69_100d_79381ffa0e04
  89ff9594_27a4_7532_5875_c413d82c94c3["decode()"]
  7a6947b9_edc8_6ed8_f6ad_f257a2519043 -->|calls| 89ff9594_27a4_7532_5875_c413d82c94c3
  style 7a6947b9_edc8_6ed8_f6ad_f257a2519043 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java lines 242–257

        @Override
        public void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
            try {
                if (ctx.channel().isActive() && readClientPrefaceString(in) && verifyFirstFrameIsSettings(in)) {
                    // After the preface is read, it is time to hand over control to the post initialized decoder.
                    byteDecoder = new FrameDecoder();
                    byteDecoder.decode(ctx, in, out);
                }
            } catch (Throwable e) {
                if (byteDecoder != null) {
                    // Skip all bytes before we report the exception as
                    in.skipBytes(in.readableBytes());
                }
                onError(ctx, false, e);
            }
        }

Domain

Subdomains

Frequently Asked Questions

What does decode() do?
decode() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java.
Where is decode() defined?
decode() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java at line 242.
What does decode() call?
decode() calls 4 function(s): decode, onError, readClientPrefaceString, verifyFirstFrameIsSettings.

Analyze Your Own Codebase

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

Try Supermodel Free