Creates a new Reader
and initialises the
wrapped buffer to the given size
.
The size of the buffer.
The wrapped buffer.
The current index of the buffer.
The default size when this reader is reset.
The length of the buffer.
The number of bytes between the end of the buffer and the current index.
Reads a single byte from the buffer, returns true
if the byte is 1
and false
otherwise.
Reads a 1 byte integer from the buffer.
Reads 2 bytes to get the length, then reads length
bytes from the buffer.
Reads size
bytes from the buffer.
The number of bytes to read.
Reads a 4 byte floating point number from the buffer.
Reads a 4 byte integer from the buffer.
Reads a 2 byte integer from the buffer.
Reads 2 bytes to get the length, reads length
bytes from the buffer, then converts
the result to a utf8 string.
The same as readString()
, but reads 4 bytes for the length.
Reads a 4 byte unsigned integer from the buffer.
Reads a 1 byte unsigned integer from the buffer.
Reads a 2 byte unsigned integer from the buffer.
Resets the bufferIndex
to 0
and allocates a fresh buffer of length DEFAULT_SIZE
to the underlying buffer.
Changes the size of the buffer without affecting the contents.
The new size of the buffer.
Generated using TypeDoc
A wrapper class which provides methods to read data from the raw bytes of a buffer.