Home / Function/ AsciiString() — netty Function Reference

AsciiString() — netty Function Reference

Architecture documentation for the AsciiString() function in HpackHuffmanDecoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4640aa1f_f858_555f_6193_01f4a9427401["AsciiString()"]
  75ae760e_009e_dc0c_af13_9cd0fad0853b["HpackHuffmanDecoder"]
  4640aa1f_f858_555f_6193_01f4a9427401 -->|defined in| 75ae760e_009e_dc0c_af13_9cd0fad0853b
  7ab112f9_1f08_f8d9_4b84_1251288c391a["process()"]
  4640aa1f_f858_555f_6193_01f4a9427401 -->|calls| 7ab112f9_1f08_f8d9_4b84_1251288c391a
  style 4640aa1f_f858_555f_6193_01f4a9427401 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/HpackHuffmanDecoder.java lines 4684–4712

    public AsciiString decode(ByteBuf buf, int length) throws Http2Exception {
        if (length == 0) {
            return AsciiString.EMPTY_STRING;
        }
        dest = new byte[length * 8 / 5];
        try {
            int readerIndex = buf.readerIndex();
            // Using ByteProcessor to reduce bounds-checking and reference-count checking during byte-by-byte
            // processing of the ByteBuf.
            int endIndex = buf.forEachByte(readerIndex, length, this);
            if (endIndex == -1) {
                // We did consume the requested length
                buf.readerIndex(readerIndex + length);
                if ((state & HUFFMAN_COMPLETE_SHIFT) != HUFFMAN_COMPLETE_SHIFT) {
                    throw BAD_ENCODING;
                }
                return new AsciiString(dest, 0, k, false);
            }

            // The process(...) method returned before the requested length was requested. This means there
            // was a bad encoding detected.
            buf.readerIndex(endIndex);
            throw BAD_ENCODING;
        } finally {
            dest = null;
            k = 0;
            state = 0;
        }
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does AsciiString() do?
AsciiString() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/HpackHuffmanDecoder.java.
Where is AsciiString() defined?
AsciiString() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/HpackHuffmanDecoder.java at line 4684.
What does AsciiString() call?
AsciiString() calls 1 function(s): process.

Analyze Your Own Codebase

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

Try Supermodel Free