Function: readTemplate16()
ts
function readTemplate16(cursor): number;Defined in: cursor/readTemplate16.ts:18
Reads an unsigned fixed-point value of 2 bytes (8.8): 1 byte for the integer part and 1 byte for the fraction.
Parameters
cursor
The cursor to read from. The function moves the cursor past the field.
Returns
number
The value of the field.
Throws
RangeError if the field passes cursor.end.
Example
ts
// The body of an `mfhd` box: version, flags, and sequence_number.
const cursor = createIsoBoxReadCursor(new Uint8Array([0, 0, 0, 0, 0, 0, 0, 7]))
const version = readUint8(cursor) // 0
const flags = readUint24(cursor) // 0
const sequenceNumber = readUint32(cursor) // 7