readFrameAt
readFrameAt(
bytes,offset):Frame
Defined in: packages/distillate/src/core/serialize.ts:328
Reads and validates the frame starting at offset in bytes, which may
hold further frames after it: magic, version, declared length, CRC32 and
reserved bits, without needing to know the structure type. Advance by the
returned byteLength to walk a buffer of concatenated frames.
Parameters
Section titled “Parameters”Uint8Array
offset
Section titled “offset”number
Returns
Section titled “Returns”Throws
Section titled “Throws”TruncatedError when the frame runs past the end of bytes.
Throws
Section titled “Throws”BadMagicError, UnknownVersionError, ChecksumError or
ReservedBitsError when the frame at offset is not one this release reads.
Throws
Section titled “Throws”RangeError when offset is not a non-negative integer.