Function: writeFourCc()
ts
function writeFourCc(cursor, value): void;Defined in: cursor/writeFourCc.ts:17
Writes a four-character code of 4 bytes, such as a box type or a brand.
Parameters
cursor
The cursor to write to. The function moves the cursor past the code.
value
string
The code. Each character is one byte.
Returns
void
Throws
RangeError if value does not have 4 characters, or a character is above U+00FF. 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