Grows the buffer's capacity, if necessary, to guarantee space for
another n bytes. After .grow(n), at least n bytes can be written to
the buffer without another allocation. If n is negative, .grow() will
throw. If the buffer can't grow it will throw an error.
Reads the next p.length bytes from the buffer or until the buffer is
drained. Resolves to the number of bytes read. If the buffer has no
data to return, resolves to EOF (null).
Reads data from r until EOF (null) and appends it to the buffer,
growing the buffer as needed. It resolves to the number of bytes read.
If the buffer becomes too large, .readFrom() will reject with an error.
Reads data from r until EOF (null) and appends it to the buffer,
growing the buffer as needed. It returns the number of bytes read. If the
buffer becomes too large, .readFromSync() will throw an error.
Reads the next p.length bytes from the buffer or until the buffer is
drained. Returns the number of bytes read. If the buffer has no data to
return, the return is EOF (null).
Discards all but the first n unread bytes from the buffer but
continues to use the same allocated storage. It throws if n is
negative or greater than the length of the buffer.
Writes p.byteLength bytes from p to the underlying data
stream. It returns the number of bytes written from p (0 <= n
<= p.byteLength) and any error encountered that caused the write to
stop early. writeSync() must throw a non-null error if it returns n <
p.byteLength. writeSync() must not modify the slice data, even
temporarily.