Skip to content

Function: writeBytes() ​

ts
function writeBytes(cursor, data): void;

Defined in: cursor/writeBytes.ts:19

Writes a number of bytes.

Parameters ​

cursor ​

IsoBoxWriteCursor

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

data ​

ArrayLike<number>

The bytes to write, such as a Uint8Array or an array of numbers.

Returns ​

void

Throws ​

RangeError if data has no length, or an item is not an integer from 0 to 255. The cursor does not move.

Example ​

ts
const cursor = createIsoBoxWriteCursor()

writeBytes(cursor, new Uint8Array([1, 2]))
writeBytes(cursor, [3, 4, 5])

A Streaming Video Technology Alliance project.