NodeHostBuffer
A NodeBufferInstance backed by a NIO byteBuffer. The entirety of the buffer is used, thus byteOffset is always zero and length is set to the remaining bytes in the buffer.
The backing buffer's position and limit are assumed to remain constant and should therefore not be modified in any case; doing so will cause unspecified behavior.
Properties
A simple value wrapper for the backing byteBuffer; the JavaScript engine will treat it as an ArrayBuffer
automatically, making it compatible with the Node.js API.
Unlike the original Node.js Buffer instances, no byte offset is used by this class, as each buffer is backed by its own ByteBuffer, making this value always zero.
Returns the number of usable bytes in the backing byteBuffer. Note that methods in this class do not move the buffer's position or limit, and as such both values are assumed to remain constant, making this property also a constant calculated during construction.
Functions
Returns an iterable value which yields, for every byte in the buffer, an array with the index as the first element and the byte as a second element.
Returns the byte index of the first occurrence of value in the buffer after byteOffset, or -1 if it is not found. The value may be a number (coerced into byte size), a string, another buffer, or a Uint8Array. The encoding will be used for string values if available.
Returns an iterable value which yields the buffer's keys (indices).
Returns the byte index of the last occurrence of value in the buffer after byteOffset, or -1 if it is not found. The value may be a number (coerced into byte size), a string, another buffer, or a Uint8Array. The encoding will be used for string values if available.
Read a 64-bit integer from the buffer using the Big Endian byte order, optionally at an offset.
Read a 64-bit integer from the buffer using the Little Endian byte order, optionally at an offset.
Read a 64-bit unsigned integer from the buffer using the Big Endian byte order, optionally at an offset.
Read a 64-bit unsigned integer from the buffer using the Little Endian byte order, optionally at an offset.
Read a 64-bit double-precision floating point value from the buffer using the Big Endian byte order, optionally at an offset.
Read a 64-bit double-precision floating point value from the buffer using the Little Endian byte order, optionally at an offset.
Read a 32-bit floating point value from the buffer using the Big Endian byte order, optionally at an offset.
Read a 32-bit floating point value from the buffer using the Little Endian byte order, optionally at an offset.
Read a 16-bit integer from the buffer using the Big Endian byte order, optionally at an offset.
Read a 16-bit integer from the buffer using the Little Endian byte order, optionally at an offset.
Read a 32-bit integer from the buffer using the Big Endian byte order, optionally at an offset.
Read a 32-bit integer from the buffer using the Little Endian byte order, optionally at an offset.
Read a 16-bit unsigned integer from the buffer using the Big Endian byte order, optionally at an offset.
Read a 16-bit unsigned integer from the buffer using the Little Endian byte order, optionally at an offset.
Read a 32-bit unsigned integer from the buffer using the Big Endian byte order, optionally at an offset.
Read a 32-bit unsigned integer from the buffer using the Little Endian byte order, optionally at an offset.
Read an unsigned integer with the specified byteLength (in bytes, up to 6 bytes/48 bits) using the Big Endian byte order, at the given offset.
Read an unsigned integer with the specified byteLength (in bytes, up to 6 bytes/48 bits) using the Little Endian byte order, at the given offset.
Returns a new Buffer instance as a view of this buffer's contents in the given range. Updates to this buffer's data are visible to the returned instance.
Interpret this buffer as containing only 16-bit integers and swap their byte order in-place. If the buffer's byte length is not a multiple of 2, an error will be thrown.
Interpret this buffer as containing only 32-bit integers and swap their byte order in-place. If the buffer's byte length is not a multiple of 4, an error will be thrown.
Interpret this buffer as containing only 64-bit integers and swap their byte order in-place. If the buffer's byte length is not a multiple of 8, an error will be thrown.
Returns a JSON object representation of this buffer, with the data rendered into an array of byte values.
Returns an iterable value which yields the buffer's byte values.
Write an 64-bit signed integer to the buffer at an offset using Big Endian order.
Write an 64-bit signed integer to the buffer at an offset using Little Endian order.
Write an 64-bit unsigned integer to the buffer at an offset using Big Endian order.
Write an 64-bit unsigned integer to the buffer at an offset using Little Endian order.
Write a 64-bit double-precision floating point value from the buffer using the Big Endian byte order, optionally at an offset.
Write a 64-bit double-precision floating point value from the buffer using the Little Endian byte order, optionally at an offset.
Write a 32-bit floating point value from the buffer using the Big Endian byte order, optionally at an offset.
Write a 32-bit floating point value from the buffer using the Little Endian byte order, optionally at an offset.
Write an 16-bit signed integer to the buffer at an offset using Big Endian order.
Write an 16-bit signed integer to the buffer at an offset using Little Endian order.
Write an 32-bit signed integer to the buffer at an offset using Big Endian order.
Write an 32-bit signed integer to the buffer at an offset using Little Endian order.
WRite an integer with the specified byteLength (in bytes, up to 6 bytes/48 bits) using the Big Endian byte order, at the given offset.
Read an integer with the specified byteLength (in bytes, up to 6 bytes/48 bits) using the Little Endian byte order, at the given offset.
Write an 16-bit unsigned integer to the buffer at an offset using Big Endian order.
Write an 16-bit unsigned integer to the buffer at an offset using Little Endian order.
Write an 32-bit unsigned integer to the buffer at an offset using Big Endian order.
Write an 32-bit unsigned integer to the buffer at an offset using Little Endian order.
Write an 8-bit unsigned integer to the buffer at an offset.
Read an unsigned integer with the specified byteLength (in bytes, up to 6 bytes/48 bits) using the Big Endian byte order, at the given offset.
Read an unsigned integer with the specified byteLength (in bytes, up to 6 bytes/48 bits) using the Little Endian byte order, at the given offset.