Skip to content

Function: writeInt32() ​

ts
function writeInt32(cursor, value): void;

Defined in: cursor/writeInt32.ts:18

Writes a signed integer of 4 bytes.

Parameters ​

cursor ​

IsoBoxWriteCursor

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

value ​

number

The value to write.

Returns ​

void

Throws ​

RangeError if value is not an integer from -2147483648 to 2147483647. 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.