Reference to the internal ArrayBuffer object.
Byte length of the internal ArrayBuffer.
Byte offset of the internal ArrayBuffer.
Byte length of the internal ArrayBuffer.
The current offset of the buffer's pointer.
Checks if the memory allocated to the buffer is sufficient to store more bytes after the offset.
The needed memory in bytes.
true
if there is sufficient space and false
otherwise.
Move the pointer n bytes backward.
Number of bytes to move back.
Read the next n
bytes, return a string decoded with encoding
and move pointer
forward by n
bytes.
If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8}
Make sure the buffer has sufficient memory to write a given byteLength at the current pointer offset. If the buffer's memory is insufficient, this method will create a new buffer (a copy) with a length that is twice (byteLength + current offset).
Check if big-endian mode is used for reading and writing multi-byte values.
true
if big-endian mode is used, false
otherwise.
Check if little-endian mode is used for reading and writing multi-byte values.
true
if little-endian mode is used, false
otherwise.
Store the current pointer offset.
Pop the last pointer offset from the mark stack, and set the current pointer offset to the popped value.
Push the current pointer offset to the mark stack.
Creates an array of corresponding to the type type
and size size
.
For example type uint8
will create a Uint8Array
.
size of the resulting array
number type of elements to read
Read a 64-bit signed integer number and move pointer forward by 8 bytes.
Read a 64-bit unsigned integer number and move pointer forward by 8 bytes.
Read a byte and return false if the byte's value is 0, or true otherwise. Moves pointer forward by one byte.
Alias for {@link IOBuffer#readUint8}.
Read n
bytes and move pointer forward by n
bytes.
Read a 1-byte ASCII character and move pointer forward by 1 byte.
Read n
1-byte ASCII characters and move pointer forward by n
bytes.
Read a 32-bit floating number and move pointer forward by 4 bytes.
Read a 64-bit floating number and move pointer forward by 8 bytes.
Read a 16-bit signed integer and move pointer forward by 2 bytes.
Read a 32-bit signed integer and move pointer forward by 4 bytes.
Read a signed 8-bit integer and move pointer forward by 1 byte.
Read a 16-bit unsigned integer and move pointer forward by 2 bytes.
Read a 32-bit unsigned integer and move pointer forward by 4 bytes.
Read an unsigned 8-bit integer and move pointer forward by 1 byte.
Read the next n
bytes, return a UTF-8 decoded string and move pointer
forward by n
bytes.
Move the pointer back to the last pointer offset set by mark.
Move the pointer offset back to 0.
Move the pointer to the given offset.
Switches to big-endian mode for reading and writing multi-byte values.
Set little-endian mode for reading and writing multi-byte values.
Move the pointer n bytes forward.
Number of bytes to skip.
Export a Uint8Array view of the internal buffer. The view starts at the byte offset and its length is calculated to stop at the last written byte or the original length.
Write value
as a 64-bit signed bigint and move pointer forward by 8
bytes.
Write value
as a 64-bit unsigned bigint and move pointer forward by 8
bytes.
Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer forward by 1 byte.
An alias for {@link IOBuffer#writeUint8}.
Write all elements of bytes
as uint8 values and move pointer forward by
bytes.length
bytes.
Write the charCode of str
's first character as an 8-bit unsigned integer
and move pointer forward by 1 byte.
Write the charCodes of all str
's characters as 8-bit unsigned integers
and move pointer forward by str.length
bytes.
Write value
as a 32-bit floating number and move pointer forward by 4
bytes.
Write value
as a 64-bit floating number and move pointer forward by 8
bytes.
Write value
as a 16-bit signed integer and move pointer forward by 2
bytes.
Write value
as a 32-bit signed integer and move pointer forward by 4
bytes.
Write value
as an 8-bit signed integer and move pointer forward by 1 byte.
Write value
as a 16-bit unsigned integer and move pointer forward by 2
bytes.
Write value
as a 32-bit unsigned integer and move pointer forward by 4
bytes.
Write value
as an 8-bit unsigned integer and move pointer forward by 1
byte.
UTF-8 encode and write str
to the current pointer offset and move pointer
forward according to the encoded length.
The data to construct the IOBuffer with. If data is a number, it will be the new buffer's length
If data is
undefined
, the buffer will be initialized with a default length of 8KbIf data is an ArrayBuffer, SharedArrayBuffer, an ArrayBufferView (Typed Array), an IOBuffer instance, or a Node.js Buffer, a view will be created over the underlying ArrayBuffer.