Construct an input stream from a Buffer
The source Buffer.
The buffer to read from
The number of bytes in the buffer
The current reading position
Indicates if there are remaining bytes to be found
true
if there are remaining bytes
Returns the next byte in the input stream, without extracting it.
The byte that was read, or -1 if the stream is exhausted.
Read one byte.
The byte that was read, or -1 if the stream is exhausted.
Read a signed, big-endian 32-bit integer.
the number that has been read.
Read a signed, big-endian 64-bit long.
the number that has been read.
Read a signed 8-bit integer.
the number that has been read.
Read a specified amount of bytes.
If the length is greater than the remaining number of bytes, this function will read up to the last available byte in the buffer.
the number of bytes you wish to read.
the bytes that have been read
Read an unsigned, big-endian 64-bit long.
the number that has been read.
Read until a specified byte (delimiter) is found.
The buffer position is updated to point to just after the delimiter.
If the delimiter can't be found, then return all bytes until the end of the buffer.
the delimiter byte
a buffer containing the bytes up to but not including the delimiter byte.
Sequential reading of values from a given Buffer. Loosely inspired by Java's ByteArrayInputStream.