Creates a new BinaryStream instance.
The initial buffer for the stream.
Optional
offset: numberThe initial offset for the stream.
Optional
offset: numberReads an unsigned 64-bit big-endian integer from the binary stream.
Optional
offset: numberThe unsigned 64-bit big-endian integer read from the binary stream.
Reads a boolean value.
Optional
offset: numberboolean value.
Reads an unsigned/signed byte.
Optional
offset: numberThe optional offset to read from.
The read byte.
Reads an 8-byte floating-point number in big-endian format from the binary stream.
Optional
offset: numberThe 8-byte floating-point number read from the binary stream.
Reads an 8-byte floating-point number in big-endian format from the binary stream.
Optional
offset: numberThe 8-byte floating-point number read from the binary stream.
Reads an 8-byte floating-point number in little-endian format from the binary stream.
Optional
offset: numberThe 8-byte floating-point number read from the binary stream.
Reads a 32-bit floating point number in big-endian format from the binary stream.
Optional
offset: numberThe 32-bit floating point number read from the binary stream.
Reads a 32-bit floating point number in big-endian format from the binary stream.
Optional
offset: numberThe 32-bit floating point number read from the binary stream.
Reads an 8-byte floating-point number in big-endian format from the binary stream.
Optional
offset: numberThe 8-byte floating-point number read from the binary stream.
Reads a 32-bit floating point number in big-endian format from the binary stream.
Optional
offset: numberThe 32-bit floating point number read from the binary stream.
Reads a 32-bit floating-point number in little-endian format from the binary stream.
Optional
offset: numberThe 32-bit floating-point number read from the binary stream.
Reads a 32-bit signed big-endian number
Optional
offset: numberReads a 16-bit signed big-endian number.
Optional
offset: numberThe read 16-bit signed big-endian number.
Reads a 32-bit signed big-endian number
Optional
offset: numberReads a 32-bit signed big-endian number
Optional
offset: numberReads a 32-bit signed little-endian number
Optional
offset: numberReads an unsigned 64-bit big-endian integer from the binary stream.
Optional
offset: numberThe unsigned 64-bit big-endian integer read from the binary stream.
Reads an unsigned 64-bit big-endian integer from the binary stream.
Optional
offset: numberThe unsigned 64-bit big-endian integer read from the binary stream.
Reads an unsigned 64-bit little-endian integer from the binary stream.
Optional
offset: numberThe unsigned 64-bit little-endian integer read from the binary stream.
Reads a 16-bit signed big-endian number.
Optional
offset: numberThe read 16-bit signed big-endian number.
Reads a 16-bit signed big-endian number.
Optional
offset: numberThe read 16-bit signed big-endian number.
Reads a 16-bit signed little-endian number.
Optional
offset: numberThe read 16-bit signed little-endian number.
Reads a 3-byte big-endian number.
Optional
offset: numberThe read 3-byte big-endian number.
Reads a 32-bit unsigned big-endian number.
Optional
offset: numberThe read 32-bit unsigned big-endian number.
Reads a 16-bit unsigned big-endian number.
Optional
offset: numberThe read 16-bit unsigned big-endian number.
Reads a 32-bit unsigned big-endian number.
Optional
offset: numberThe read 32-bit unsigned big-endian number.
Reads a 32-bit unsigned big-endian number.
Optional
offset: numberThe read 32-bit unsigned big-endian number.
Reads a 32-bit unsigned little-endian number
Optional
offset: numberReads a 16-bit unsigned big-endian number.
Optional
offset: numberThe read 16-bit unsigned big-endian number.
Reads a 16-bit unsigned big-endian number.
Optional
offset: numberThe read 16-bit unsigned big-endian number.
Reads a 16-bit unsigned little-endian number.
Optional
offset: numberThe read 16-bit unsigned little-endian number.
Protected
viewWrites an unsigned 64-bit big-endian integer to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes a boolean value.
Optional
offset: numberThe updated BinaryStream instance.
Writes an unsigned/signed byte.
The byte to write.
Optional
offset: numberThe optional offset to write at.
The updated BinaryStream instance.
Writes an 8-byte floating-point number in big-endian format to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes an 8-byte floating-point number in big-endian format to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes an 8-byte floating-point number in little-endian format to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 32-bit floating-point number in big-endian format to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 32-bit floating-point number in big-endian format to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes an 8-byte floating-point number in big-endian format to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 32-bit floating-point number in big-endian format to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 32-bit floating-point number in little-endian format to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 32-bit signed big-endian number
Optional
offset: numberWrites a 16-bit signed big-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 32-bit signed big-endian number
Optional
offset: numberWrites a 32-bit signed big-endian number
Optional
offset: numberWrites a 32-bit signed little-endian number
Writes an unsigned 64-bit big-endian integer to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes an unsigned 64-bit big-endian integer to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes an unsigned 64-bit little-endian integer to the binary stream.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 16-bit signed big-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 16-bit signed big-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 16-bit signed little-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 3-byte big-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 32-bit unsigned big-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 16-bit unsigned big-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 32-bit unsigned big-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 32-bit unsigned big-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 32-bit unsigned little-endian number
Optional
offset: numberWrites a 16-bit unsigned big-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 16-bit unsigned big-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Writes a 16-bit unsigned little-endian number.
Optional
offset: numberThe updated BinaryStream instance.
Gets a copy of the underlying ArrayBuffer as a Uint8Array.
A copy of the ArrayBuffer.
Gets the size of the buffer.
The size of the buffer.
Checks if the current stream is equal to another stream or Uint8Array.
The stream or Uint8Array to compare.
True if the streams are equal, false otherwise.
Increases the offset of the stream and returns the start and end offsets.
The length to increase the offset by.
Optional
offset: numberThe optional offset to set.
An object containing the start and end offsets.
Reads a set of bytes from the buffer.
The number of bytes to read.
Optional
offset: numberThe optional offset to read from.
A Uint8Array containing the read bytes.
RangeError if the read operation exceeds the buffer length.
Reads an Internet address from the binary stream.
Optional
offset: numberThe optional offset to read from.
An object representing the Internet address, including the address, port, and version.
Reads an 8-byte floating-point number in big-endian format from the binary stream.
Optional
offset: numberThe optional offset to read from. If not provided, the current offset will be used.
The 8-byte floating-point number read from the binary stream.
Reads the remaining amount of bytes.
A Uint8Array containing the remaining bytes.
Sets the buffer and/or offset of the stream.
The buffer to set.
Optional
offset: numberThe optional offset to set.
The updated BinaryStream instance.
Splits the binary stream into chunks of the specified number of bytes.
The number of bytes in each chunk.
An array of Uint8Array chunks.
Writes data to the stream's buffer.
The data to write.
Optional
offset: numberThe optional offset to write the data at.
The updated BinaryStream instance.
Writes an Internet address to the binary stream.
The Internet address to write.
Optional
offset: numberThe optional offset to write at.
The updated BinaryStream instance.
Static
fromCreates a new BinaryStream from the specified buffer.
The buffer to create the BinaryStream from.
The created BinaryStream instance.
Creates a new BinaryStream from the specified string.
The string to create the BinaryStream from.
The encoding to use.
The created BinaryStream instance.
Represents a binary stream for reading and writing data.