Create a new BinaryStream instance.
Optional
buffer: Buffer<ArrayBufferLike>The buffer to use for this stream.
The buffer that this stream operates on.
The frames of the frame set.
The current offset in the buffer from which to read or write data.
The sequence of the frame set.
Static
idThe packet id.
Static
id_The packet id data type.
Deserializes the packet.
Check if the offset is at the end of the buffer.
Whether the offset is at the end.
Get the current buffer of the stream.
The current buffer up to the current offset.
Gets the packet id.
The packet id.
Gets the packet id data type.
The packet id data type.
Read a boolean value from the stream.
The read boolean value.
Read a 32-bit floating point number from the stream.
Optional
endian: EndiannessThe endianness to use for reading.
The read 32-bit float.
Read a 16-bit signed integer (i16) from the stream.
Optional
endian: EndiannessThe endianness to use for reading.
The read 16-bit signed integer.
Read a 24-bit signed integer (i24) from the stream.
Optional
endian: EndiannessThe endianness to use for reading.
The read 24-bit signed integer.
Read a 32-bit signed integer (i32) from the stream.
Optional
endian: EndiannessThe endianness to use for reading.
The read 32-bit signed integer.
Read a 64-bit signed integer (i64) from the stream.
Optional
endian: EndiannessThe endianness to use for reading.
The read 64-bit signed integer.
Read a 8-bit signed integer (i8) from the stream.
The read 8-bit signed integer.
Read a 16-bit string from the stream.
Optional
endian: EndiannessThe endianness to use for reading.
The read string.
Read a 32-bit string from the stream.
Optional
endian: EndiannessThe endianness to use for reading.
The read string.
Read a 16-bit unsigned integer (u16) from the stream.
Optional
endian: EndiannessThe endianness to use for reading.
The read 16-bit unsigned integer.
Read a 24-bit unsigned integer (u24) from the stream.
Optional
endian: EndiannessThe endianness to use for reading.
The read 24-bit unsigned integer.
Read a 32-bit unsigned integer (u32) from the stream.
Optional
endian: EndiannessThe endianness to use for reading.
The read 32-bit unsigned integer.
Read a 64-bit unsigned integer (u64) from the stream.
Optional
endian: EndiannessThe endianness to use for reading.
The read 64-bit unsigned integer.
Read a 8-bit unsigned integer (u8) from the stream.
The read 8-bit unsigned integer.
Read a variable-length integer (varint) from the stream.
The read variable-length integer.
Read a variable-length long integer (varlong) from the stream.
The read variable-length long integer.
Read a variable-length string from the stream.
The read variable-length string.
Read a ZigZag encoded integer from the stream.
The decoded integer.
Read a ZigZong encoded integer from the stream.
The decoded ZigZong integer.
Serializes the packet.
The serialized packet.
Validate if the current offset plus the specified length exceeds the buffer length.
The length to validate against the current offset.
True if the offset is valid, false otherwise.
Write a Buffer to the stream at the current offset.
The Buffer to write to the stream.
Write a boolean value to the stream.
The boolean value to write.
Write a 32-bit floating point number to the stream.
The 32-bit float to write.
Optional
endian: EndiannessThe endianness to use for writing.
Write a 16-bit signed integer (i16) to the stream.
The 16-bit signed integer to write.
Optional
endian: EndiannessThe endianness to use for writing.
Write a 24-bit signed integer (i24) to the stream.
The 24-bit signed integer to write.
Optional
endian: EndiannessThe endianness to use for writing.
Write a 32-bit signed integer (i32) to the stream.
The 32-bit signed integer to write.
Optional
endian: EndiannessThe endianness to use for writing.
Write a 64-bit signed integer (i64) to the stream.
The 64-bit signed integer to write.
Optional
endian: EndiannessThe endianness to use for writing.
Write a 8-bit signed integer (i8) to the stream.
The 8-bit signed integer to write.
Write a 16-bit string to the stream.
The string to write.
Optional
endian: EndiannessThe endianness to use for writing.
Write a 32-bit string to the stream.
The string to write.
Optional
endian: EndiannessThe endianness to use for writing.
Write a 16-bit unsigned integer (u16) to the stream.
The 16-bit unsigned integer to write.
Optional
endian: EndiannessThe endianness to use for writing.
Write a 24-bit unsigned integer (u24) to the stream.
The 24-bit unsigned integer to write.
Optional
endian: EndiannessThe endianness to use for writing.
Write a 32-bit unsigned integer (u32) to the stream.
The 32-bit unsigned integer to write.
Optional
endian: EndiannessThe endianness to use for writing.
Write a 64-bit unsigned integer (u64) to the stream.
The 64-bit unsigned integer to write.
Optional
endian: EndiannessThe endianness to use for writing.
Write a 8-bit unsigned integer (u8) to the stream.
The 8-bit unsigned integer to write.
Write a variable-length integer (varint) to the stream.
The variable-length integer to write.
Write a variable-length long integer (varlong) to the stream.
The variable-length long integer to write.
Write a variable-length string to the stream.
The string to write.
Write a ZigZag encoded integer to the stream.
The integer to encode and write.
Write a ZigZong encoded integer to the stream.
The ZigZong integer to encode and write.
Represents a frame set packet. This packet hold multiple frames.