Documentation/BinaryWriter
classWORKER

BinaryWriter

js/foo_uie_jsplitter.js:3954

Streaming binary writer returned by utils.OpenBinaryWriter.

propertyWORKERreadonly

Closed

js/foo_uie_jsplitter.js:4003
Closed: boolean = false

Indicates whether the writer has been closed.

propertyWORKERreadonly

Position

js/foo_uie_jsplitter.js:3994
Position: number = 0

Number of bytes successfully written to the file.

methodWORKER

Close

js/foo_uie_jsplitter.js:3986
Close()

Closes the file. Calling Close() more than once is allowed.

Returns

boolean —

true if the writer is closed successfully; false if closing/flushing the file fails. Calling it again after a successful close returns true.

methodWORKER

Flush

js/foo_uie_jsplitter.js:3977
Flush()

Flushes buffered output to the file.

Returns

boolean —

true on success; false if flushing fails.

Throws

Error —

If the writer is closed.

methodWORKER

Write

js/foo_uie_jsplitter.js:3963
Write(buffer, offset, count)

Writes bytes from an existing Uint8Array without creating a temporary typed array.
If offset is omitted, writing starts at index 0. If count is omitted, bytes are written up to the end of the buffer.
An explicitly supplied offset + count must fit inside the buffer.

Parameters

NameTypeDescription
bufferUint8Array

Source buffer.

offset = 0optionalnumber

Source offset in bytes.

countoptionalnumber

Number of bytes to write. Defaults to the remaining buffer size.

Returns

boolean —

true on success; false if the buffer/range is invalid or the write fails.

Throws

Error —

If the writer is closed.