readQuicVarint
readQuicVarint(
reader):number
Defined in: packages/format-varint/src/quic/read-quic-varint.ts:23
Reads one QUIC variable-length integer from reader, advancing it past the
bytes consumed.
Accepts a longer encoding than needed (0x4025 is 37): QUIC allows it
outside of frame types, and checking minimality is the protocol layer’s job
where it applies.
Time complexity: O(1).
Parameters
Section titled “Parameters”reader
Section titled “reader”ByteReader
Cursor positioned at the first byte of the encoding.
Returns
Section titled “Returns”number
The decoded value, from 0 to Number.MAX_SAFE_INTEGER.
Throws
Section titled “Throws”When fewer bytes remain than the length prefix announces.
Throws
Section titled “Throws”When the value is beyond Number.MAX_SAFE_INTEGER; QUIC
allows up to 2^62 - 1, so such an encoding is well-formed.