Home / Function/ encode() — netty Function Reference

encode() — netty Function Reference

Architecture documentation for the encode() function in HpackTestCase.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  752e1532_3a8d_0d99_13de_a7e1f0c28cf0["encode()"]
  7b46bcd3_dbd5_a8a9_21a7_007c98b4f704["HpackTestCase"]
  752e1532_3a8d_0d99_13de_a7e1f0c28cf0 -->|defined in| 7b46bcd3_dbd5_a8a9_21a7_007c98b4f704
  5331bda1_436a_69be_b1ec_2d6ae664331b["testCompress()"]
  5331bda1_436a_69be_b1ec_2d6ae664331b -->|calls| 752e1532_3a8d_0d99_13de_a7e1f0c28cf0
  style 752e1532_3a8d_0d99_13de_a7e1f0c28cf0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/HpackTestCase.java lines 180–202

    private static byte[] encode(HpackEncoder hpackEncoder, List<HpackHeaderField> headers, int maxHeaderTableSize,
                                 final boolean sensitive) throws Http2Exception {
        Http2Headers http2Headers = toHttp2Headers(headers);
        Http2HeadersEncoder.SensitivityDetector sensitivityDetector = new Http2HeadersEncoder.SensitivityDetector() {
            @Override
            public boolean isSensitive(CharSequence name, CharSequence value) {
                return sensitive;
            }
        };
        ByteBuf buffer = Unpooled.buffer();
        try {
            if (maxHeaderTableSize != -1) {
                hpackEncoder.setMaxHeaderTableSize(buffer, maxHeaderTableSize);
            }

            hpackEncoder.encodeHeaders(3 /* randomly chosen */, buffer, http2Headers, sensitivityDetector);
            byte[] bytes = new byte[buffer.readableBytes()];
            buffer.readBytes(bytes);
            return bytes;
        } finally {
            buffer.release();
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does encode() do?
encode() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/HpackTestCase.java.
Where is encode() defined?
encode() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/HpackTestCase.java at line 180.
What calls encode()?
encode() is called by 1 function(s): testCompress.

Analyze Your Own Codebase

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

Try Supermodel Free