Home / Function/ encodeAndAddEntries() — netty Function Reference

encodeAndAddEntries() — netty Function Reference

Architecture documentation for the encodeAndAddEntries() function in HpackEncoder.java from the netty codebase.

Function java Buffer Allocators calls 6 called by 1

Entity Profile

Dependency Diagram

graph TD
  67aada40_9838_0523_a316_eceb773154ab["encodeAndAddEntries()"]
  616b4418_6852_a9a9_188d_063a8768b35a["HpackEncoder"]
  67aada40_9838_0523_a316_eceb773154ab -->|defined in| 616b4418_6852_a9a9_188d_063a8768b35a
  d416f498_d09b_3bf6_6f3c_bec7a647a54f["encodeHeader()"]
  d416f498_d09b_3bf6_6f3c_bec7a647a54f -->|calls| 67aada40_9838_0523_a316_eceb773154ab
  44510029_46b0_da69_c8a0_3e118364cdd2["getIndex()"]
  67aada40_9838_0523_a316_eceb773154ab -->|calls| 44510029_46b0_da69_c8a0_3e118364cdd2
  08f30b0f_a375_ac8d_797d_f16d47e75813["latestCounter()"]
  67aada40_9838_0523_a316_eceb773154ab -->|calls| 08f30b0f_a375_ac8d_797d_f16d47e75813
  23158887_3faf_9358_cf8e_ccef0456523f["encodeLiteral()"]
  67aada40_9838_0523_a316_eceb773154ab -->|calls| 23158887_3faf_9358_cf8e_ccef0456523f
  ad61b6be_2842_eab3_02ad_0166c1c2e078["addNameEntry()"]
  67aada40_9838_0523_a316_eceb773154ab -->|calls| ad61b6be_2842_eab3_02ad_0166c1c2e078
  1c8b2193_c4e9_6059_cad2_addf4f3ff68b["addNameValueEntry()"]
  67aada40_9838_0523_a316_eceb773154ab -->|calls| 1c8b2193_c4e9_6059_cad2_addf4f3ff68b
  e6edf78d_f910_aefc_3cb9_5645291b96a9["getIndexPlusOffset()"]
  67aada40_9838_0523_a316_eceb773154ab -->|calls| e6edf78d_f910_aefc_3cb9_5645291b96a9
  style 67aada40_9838_0523_a316_eceb773154ab fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/HpackEncoder.java lines 207–229

    private void encodeAndAddEntries(ByteBuf out, CharSequence name, int nameHash, CharSequence value, int valueHash) {
        int staticTableIndex = HpackStaticTable.getIndex(name);
        int nextCounter = latestCounter() - 1;
        if (staticTableIndex == HpackStaticTable.NOT_FOUND) {
            NameEntry e = getEntry(name, nameHash);
            if (e == null) {
                encodeLiteral(out, name, value, IndexType.INCREMENTAL, NOT_FOUND);
                addNameEntry(name, nameHash, nextCounter);
                addNameValueEntry(name, value, nameHash, valueHash, nextCounter);
            } else {
                encodeLiteral(out, name, value, IndexType.INCREMENTAL, getIndexPlusOffset(e.counter));
                addNameValueEntry(e.name, value, nameHash, valueHash, nextCounter);

                // The name entry should always point to the latest counter.
                e.counter = nextCounter;
            }
        } else {
            encodeLiteral(out, name, value, IndexType.INCREMENTAL, staticTableIndex);
            // use the name from the static table to optimize memory usage.
            addNameValueEntry(
              HpackStaticTable.getEntry(staticTableIndex).name, value, nameHash, valueHash, nextCounter);
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does encodeAndAddEntries() do?
encodeAndAddEntries() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/HpackEncoder.java.
Where is encodeAndAddEntries() defined?
encodeAndAddEntries() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/HpackEncoder.java at line 207.
What does encodeAndAddEntries() call?
encodeAndAddEntries() calls 6 function(s): addNameEntry, addNameValueEntry, encodeLiteral, getIndex, getIndexPlusOffset, latestCounter.
What calls encodeAndAddEntries()?
encodeAndAddEntries() is called by 1 function(s): encodeHeader.

Analyze Your Own Codebase

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

Try Supermodel Free