Skip to content

Function: writeUint64() ​

ts
function writeUint64(cursor, value): void;

Defined in: cursor/writeUint64.ts:19

Writes an unsigned integer of 8 bytes from a bigint.

The function needs the setBigUint64 method of DataView.

Parameters ​

cursor ​

IsoBoxWriteCursor

The cursor to write to. The function moves the cursor past the field.

value ​

bigint

The value to write, from 0 to 2^64 - 1.

Returns ​

void

Throws ​

RangeError if value is not a bigint from 0 to 2^64 - 1. The cursor does not move.

Example ​

ts
const cursor = createIsoBoxWriteCursor()

writeUint8(cursor, 1) // version
writeUint24(cursor, 0x000201) // flags
writeUint32(cursor, 7)

const bytes = cursor.bytes.subarray(0, cursor.pos) // 01 00 02 01 00 00 00 07

A Streaming Video Technology Alliance project.