Number of bytes available to be read
Total number of bytes in the underlying buffer
Number of bytes written
Read data from the underlying source into the provided Uint8Array, up to the length of the array, and return the number of bytes read.
If there are no bytes available currently, the implementation is supposed to wait until at least one byte is available, and only then resolve the promise. Resolving the promise with a zero-length Uint8Array is marking the end of the source.
Uint8Array containing the bytes that were read.
Read the specified number of bytes from the source and return them as a Uint8Array.
The returned Uint8Array:
readSync
these constraints allow for more efficient zero-copy implementations in many cases
The number of bytes to read
Uint8Array containing the bytes that were read.
Write the specified number of bytes to the underlying source.
The implementation is supposed to make sure there are at least bytes
bytes
available in the underlying source and return a Uint8Array that can be written to.
The returned Uint8Array must be valid at least until the next call to writeSync
or disposeWriteSync
.
If the caller writes less than bytes
bytes to the returned Uint8Array,
disposeWriteSync
must be called with the number of bytes that were actually written.
Uint8Array of length bytes
that can be written to
Static
allocStatic
from
a byte buffer implementing fuman readable/writable streams