Home / Function/ decode() — netty Function Reference

decode() — netty Function Reference

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

Function java Buffer Allocators calls 13 called by 1

Entity Profile

Dependency Diagram

graph TD
  678f973e_104e_7340_6c3b_b4ef23003fe0["decode()"]
  90fa2d3f_8d04_4c74_e2ce_52229be77194["QpackDecoder"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|defined in| 90fa2d3f_8d04_4c74_e2ce_52229be77194
  1ab239e7_73c5_2e7a_f5d7_17805c4d557e["CharSequence()"]
  1ab239e7_73c5_2e7a_f5d7_17805c4d557e -->|calls| 678f973e_104e_7340_6c3b_b4ef23003fe0
  17f145b9_9c07_732a_f118_6a866c5843ea["decodeRequiredInsertCount()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| 17f145b9_9c07_732a_f118_6a866c5843ea
  96e236e5_28fb_6d2b_ff68_8d3721dab9a8["shouldWaitForDynamicTableUpdates()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| 96e236e5_28fb_6d2b_ff68_8d3721dab9a8
  798116b5_14c9_bfbb_a4c9_98f7cdad82a3["decodeBase()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| 798116b5_14c9_bfbb_a4c9_98f7cdad82a3
  4668ff57_4979_5f8d_1ffa_85bfe92168f0["isIndexed()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| 4668ff57_4979_5f8d_1ffa_85bfe92168f0
  e4c523f1_b420_82d8_ae49_39b9bbc2cdce["decodeIndexed()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| e4c523f1_b420_82d8_ae49_39b9bbc2cdce
  8ddb6d46_a7cb_2028_0f98_07f9e2058996["isIndexedWithPostBase()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| 8ddb6d46_a7cb_2028_0f98_07f9e2058996
  cccdf44c_a496_bce0_58f2_526c2bec2944["decodeIndexedWithPostBase()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| cccdf44c_a496_bce0_58f2_526c2bec2944
  029640e9_bd93_8bf3_9c94_6097a4aaf643["isLiteralWithNameRef()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| 029640e9_bd93_8bf3_9c94_6097a4aaf643
  2fd641da_fde9_9d66_eca9_4c340c9a6b26["decodeLiteralWithNameRef()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| 2fd641da_fde9_9d66_eca9_4c340c9a6b26
  2f6814a7_a9ce_9143_6ad0_94d72c16edab["isLiteralWithPostBaseNameRef()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| 2f6814a7_a9ce_9143_6ad0_94d72c16edab
  e8404a6c_c826_2b73_7dc3_c1a5524eba67["decodeLiteralWithPostBaseNameRef()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| e8404a6c_c826_2b73_7dc3_c1a5524eba67
  1cfea281_94c3_17d6_c486_4b45ad3a2de9["isLiteral()"]
  678f973e_104e_7340_6c3b_b4ef23003fe0 -->|calls| 1cfea281_94c3_17d6_c486_4b45ad3a2de9
  style 678f973e_104e_7340_6c3b_b4ef23003fe0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http3/src/main/java/io/netty/handler/codec/http3/QpackDecoder.java lines 112–153

    public boolean decode(QpackAttributes qpackAttributes, long streamId, ByteBuf in,
                          int length, BiConsumer<CharSequence, CharSequence> sink, Runnable whenDecoded)
            throws QpackException {
        final int initialReaderIdx = in.readerIndex();
        final int requiredInsertCount = decodeRequiredInsertCount(qpackAttributes, in);
        if (shouldWaitForDynamicTableUpdates(requiredInsertCount)) {
            blockedStreamsCount++;
            blockedStreams.computeIfAbsent(requiredInsertCount, __ -> new ArrayList<>(2)).add(whenDecoded);
            in.readerIndex(initialReaderIdx);
            return false;
        }

        in = in.readSlice(length - (in.readerIndex() - initialReaderIdx));
        final int base = decodeBase(in, requiredInsertCount);

        while (in.isReadable()) {
            byte b = in.getByte(in.readerIndex());
            if (isIndexed(b)) {
                decodeIndexed(in, sink, base);
            } else if (isIndexedWithPostBase(b)) {
                decodeIndexedWithPostBase(in, sink, base);
            } else if (isLiteralWithNameRef(b)) {
                decodeLiteralWithNameRef(in, sink, base);
            } else if (isLiteralWithPostBaseNameRef(b)) {
                decodeLiteralWithPostBaseNameRef(in, sink, base);
            } else if (isLiteral(b)) {
                decodeLiteral(in, sink);
            } else {
                throw UNKNOWN_TYPE;
            }
        }
        if (requiredInsertCount > 0) {
            assert !qpackAttributes.dynamicTableDisabled();
            assert qpackAttributes.decoderStreamAvailable();

            stateSyncStrategy.sectionAcknowledged(requiredInsertCount);
            final ByteBuf sectionAck = qpackAttributes.decoderStream().alloc().buffer(8);
            encodePrefixedInteger(sectionAck, (byte) 0b1000_0000, 7, streamId);
            closeOnFailure(qpackAttributes.decoderStream().writeAndFlush(sectionAck));
        }
        return true;
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does decode() do?
decode() is a function in the netty codebase, defined in codec-http3/src/main/java/io/netty/handler/codec/http3/QpackDecoder.java.
Where is decode() defined?
decode() is defined in codec-http3/src/main/java/io/netty/handler/codec/http3/QpackDecoder.java at line 112.
What does decode() call?
decode() calls 13 function(s): decodeBase, decodeIndexed, decodeIndexedWithPostBase, decodeLiteral, decodeLiteralWithNameRef, decodeLiteralWithPostBaseNameRef, decodeRequiredInsertCount, isIndexed, and 5 more.
What calls decode()?
decode() is called by 1 function(s): CharSequence.

Analyze Your Own Codebase

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

Try Supermodel Free