Home / Function/ ByteBuf() — netty Function Reference

ByteBuf() — netty Function Reference

Architecture documentation for the ByteBuf() function in QuicHeaderParser.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  a4f94f0b_5587_d928_f3fc_be19cc9bcfc4["ByteBuf()"]
  c7e41129_a960_2079_d47e_46ceea19e35c["QuicHeaderParser"]
  a4f94f0b_5587_d928_f3fc_be19cc9bcfc4 -->|defined in| c7e41129_a960_2079_d47e_46ceea19e35c
  8c03fba7_750c_033c_0ce0_7bb5c59ba68a["checkReadable()"]
  a4f94f0b_5587_d928_f3fc_be19cc9bcfc4 -->|calls| 8c03fba7_750c_033c_0ce0_7bb5c59ba68a
  401289e2_5203_16b5_e109_038634d7531b["numBytesForVariableLengthInteger()"]
  a4f94f0b_5587_d928_f3fc_be19cc9bcfc4 -->|calls| 401289e2_5203_16b5_e109_038634d7531b
  5ae8919b_456e_6bed_711b_5be295e22b94["getVariableLengthInteger()"]
  a4f94f0b_5587_d928_f3fc_be19cc9bcfc4 -->|calls| 5ae8919b_456e_6bed_711b_5be295e22b94
  style a4f94f0b_5587_d928_f3fc_be19cc9bcfc4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicHeaderParser.java lines 154–176

    private static ByteBuf sliceToken(QuicPacketType type, ByteBuf packet, int offset, int readable)
            throws QuicException {
        switch (type) {
            case INITIAL:
                // See
                checkReadable(offset, readable, Byte.BYTES);
                int numBytes = numBytesForVariableLengthInteger(packet.getByte(offset));
                int len = (int) getVariableLengthInteger(packet, offset, numBytes);
                offset += numBytes;

                checkReadable(offset, readable, len);
                return packet.slice(offset, len);
            case RETRY:
                // Exclude the integrity tag from the token.
                // See https://www.rfc-editor.org/rfc/rfc9000.html#section-17.2.5
                checkReadable(offset, readable, AES_128_GCM_TAG_LENGTH);
                int tokenLen = readable - offset - AES_128_GCM_TAG_LENGTH;
                return packet.slice(offset, tokenLen);
            default:
                // No token included.
                return Unpooled.EMPTY_BUFFER;
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does ByteBuf() do?
ByteBuf() is a function in the netty codebase, defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicHeaderParser.java.
Where is ByteBuf() defined?
ByteBuf() is defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicHeaderParser.java at line 154.
What does ByteBuf() call?
ByteBuf() calls 3 function(s): checkReadable, getVariableLengthInteger, numBytesForVariableLengthInteger.

Analyze Your Own Codebase

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

Try Supermodel Free