QuicPacketDecoder encapsulates the logic to decode a
quic packet. A QuicPacketDecoder is typically tied to
a particular version of the QUIC protocol.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class | |
| private abstract static class | |
| private static class | |
| public abstract static class | |
| private static class | |
| private abstract static class | |
| private static class | |
| private static class | |
| pack-priv class | QuicPacketDecoder.
A |
| Modifier and Type | Field and Description |
|---|---|
| private static final Logger | |
| private final QuicVersion |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static int | Returns: the connection ID lengththe connection ID length byte. length)Reads a connection ID length from the connection ID length byte. |
| public QuicPacketDecoder. | decode(ByteBuffer
the buffer with the bytes to be decoded buffer, CodingContext the decoding context context)Decode the contents of the given |
| private static QuicConnectionId | |
| private static QuicPacket. | Returns: the headers type encoded in the given byte.the first byte of a quic packet first)Reads the headers type from the given byte. |
| private static boolean | Returns: true if the first packet in the buffer is a version negotiation packet.the buffer containing the packet. buffer, int the offset at which the packet starts. offset)Returns true if the first packet in the buffer is a version negotiation packet. |
| public ByteBuffer | Returns: the next packet.a buffer containing coalesced packets buffer, int the offset at which the next packet starts offset)Find the length of the next packet in the buffer, and return the next packet bytes as a slice of the original packet. |
| public static QuicPacketDecoder | Returns: a decoder for the given Quic version ornullthe Quic protocol version number quicVersion)Returns a decoder for the given Quic version. |
| public static QuicPacketDecoder | Returns: AQuicPacketDecoder instance to decode the
packet starting at the given offset.A buffer containing a Quic packet buffer, int The offset at which the packet starts offset)Returns a |
| private QuicPacket. | Returns: the packet type encoded in the given byte.the first byte of a quic packet headerByte)Reads the Quic V1 packet type from the given byte. |
| public static QuicPacket. | Returns: the header's type of the packet contained in this byte buffer. NONE if the header's type cannot be determined.the byte buffer containing a packet. buffer, int the offset at which the packet starts. offset)Peeks at the headers type in the given byte buffer. |
| public static ByteBuffer | Returns: token or null if packet is malformedthe buffer containing an initial packet. buffer)Returns a bytebuffer containing the token from initial packet. |
| public static ByteBuffer | Returns: A ByteBuffer slice containing the connection id bytes, or null if the packet is malformed and the connection id could not be read.the buffer containing a long headers packet. buffer)Peeks at the connection id in the long header packet bytes. |
| public static LongHeader | Returns: A LongHeader containing the packet header data, or null if the packet is malformedthe buffer containing a long header packet. buffer)Peeks at the header in the long header packet bytes. |
| public static LongHeader | Returns: A LongHeader containing the packet header data, or null if the packet is malformedthe buffer containing a long header packet. buffer, int the position of the start of the packet offset)Peeks at the header in the long header packet bytes. |
| private int | Returns: the position just after the first packet present in the buffer.the first packet type. Must be INITIAL, HANDSHAKE, or ZERORTT. type,the byte buffer containing the packet buffer)Returns the position just after the first packet present in the buffer. |
| public int | Returns: the size of the first packet present in the buffer.A byte buffer containing quic packets buffer)Peek at the size of the first packet present in the buffer. |
| public QuicPacket. | |
| public QuicPacket. | |
| public static ByteBuffer | Returns: A ByteBuffer slice containing the connection id bytes, or null if the packet is malformed and the connection id could not be read.the buffer containing a short headers packet. buffer, int the connection id length. length)Peeks at the connection id in the short header packet bytes. |
| public static int | Returns: the version of the packet in the buffer, or 0.the buffer containing the packet. buffer)Returns the version of the first packet in the buffer. |
| public static int | Returns: the version of the packet in the buffer, or 0.the buffer containing the packet. buffer, int the offset at which the packet starts. offset)Returns the version of the first packet in the buffer. |
| public void | skipPacket(ByteBuffer
A byte buffer containing quic packets buffer, int The offset at which the packet starts offset)Advance the bytebuffer position to the end of the packet |