Function: createIsoBoxWriteCursor()
ts
function createIsoBoxWriteCursor(config?): IsoBoxWriteCursor;Defined in: createIsoBoxWriteCursor.ts:17
Creates a write cursor.
Parameters
config?
The configuration. capacity is the size of the first buffer in bytes. The default is 1024. writers is the writers map of writeChildBoxes.
capacity?
number
writers?
Returns
A cursor at the first byte of an empty buffer.
Throws
RangeError if capacity is negative.
Example
ts
const cursor = createIsoBoxWriteCursor({ capacity: 64 })
writeUint32(cursor, 7)
const bytes = cursor.bytes.subarray(0, cursor.pos) // 00 00 00 07