Skip to content

Function: writeTerminatedUtf8() ​

ts
function writeTerminatedUtf8(cursor, value): void;

Defined in: cursor/writeTerminatedUtf8.ts:21

Writes text as UTF-8, then one null byte.

A read with readTerminatedUtf8 stops at the first U+0000, so the text cannot have that character.

Parameters ​

cursor ​

IsoBoxWriteCursor

The cursor to write to. The function moves the cursor past the null byte.

value ​

string

The text to write.

Returns ​

void

Throws ​

RangeError if value is not a string or has a U+0000. The cursor does not move.

Example ​

ts
const cursor = createIsoBoxWriteCursor()

writeTerminatedUtf8(cursor, 'a') // writes 61 00

A Streaming Video Technology Alliance project.