Http3FrameDecoder
Defined in: packages/format-http/src/h3/http3-frame-codec.ts:85
Splits one HTTP/3 stream’s bytes (after its type, for a unidirectional one) into frames (RFC 9114 §7), in any chunking.
DATA payloads are not buffered: each chunk’s share comes out as a piece, a view into that chunk, valid only as long as the chunk is. Other frames are buffered whole, up to the configured limits. Unknown and grease frame types are skipped without buffering; a frame type that is reserved, or not allowed on this kind of stream, is a connection error. Field sections are left QPACK-encoded: decoding them depends on the connection’s QPACK state.
Decoding is O(n) in the bytes received.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Http3FrameDecoder(
options):Http3FrameDecoder
Defined in: packages/format-http/src/h3/http3-frame-codec.ts:96
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Http3FrameDecoder
Methods
Section titled “Methods”decode()
Section titled “decode()”decode(
chunk):Http3Frame[]
Defined in: packages/format-http/src/h3/http3-frame-codec.ts:105
Decode the frames chunk completes.
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”The frames, and the DATA pieces, in order.
Throws
Section titled “Throws”When a frame is malformed, too large, or not allowed here.
end():
void
Defined in: packages/format-http/src/h3/http3-frame-codec.ts:139
The stream ended.
Returns
Section titled “Returns”void
Throws
Section titled “Throws”H3_FRAME_ERROR when it ended inside a frame.