Documentation/BinaryReader
classWORKER

BinaryReader

js/foo_uie_jsplitter.js:3885

Streaming binary reader returned by utils.OpenBinaryReader.

propertyWORKERreadonly

Closed

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

Indicates whether the reader has been closed.

propertyWORKERreadonly

EOF

js/foo_uie_jsplitter.js:3934
EOF: boolean = false

Indicates that the current read position has reached the file length recorded when the reader was opened.
This property does not report a closed reader or a read failure. Use the return value of Read to drive the read loop; EOF is status information used to distinguish a clean end of file from a failed read.

propertyWORKERreadonly

Length

js/foo_uie_jsplitter.js:3916
Length: number = 0

File size in bytes as observed when the reader was opened.

propertyWORKERreadonly

Position

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

Number of bytes successfully read from the file.

methodWORKER

Close

js/foo_uie_jsplitter.js:3908
Close()

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

Returns

boolean —

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

methodWORKER

Read

js/foo_uie_jsplitter.js:3894
Read(buffer, offset, count)

Reads bytes into an existing Uint8Array without allocating a new buffer.
If offset is omitted, reading starts at index 0. If count is omitted, bytes are read up to the end of the buffer.
An explicitly supplied offset + count must fit inside the buffer.

Parameters

NameTypeDescription
bufferUint8Array

Destination buffer.

offset = 0optionalnumber

Destination offset in bytes.

countoptionalnumber

Maximum number of bytes to read. Defaults to the remaining buffer size.

Returns

number —

Number of bytes actually read. A nonzero request returning 0 means that no bytes were read: EOF is true at clean end of file and false if the read could not be performed. A zero-length request also returns 0.

Throws

Error —

If the reader is closed.