This is a utility class that simplifies and unifies write operations over some writable handle-like obejct.
Usually, application software does not construct streams but use u8 sources for it. Use constructor only to connect new source.
const output = new OutputStream(handle, buferLength = defaultBufferSize);
handle: handle-like object providing
async read(maxSize)returning proxy resolving to
Unit8Arraywith loaded data.
await output.write([1,2,3]); // write bytes 0x01, 0x02 and 0x03
writes bunary data from array which should contain byte-size numbers e.g. (0..255) or an Unit8Array instance.
The promise resovles when all data are written. It is safe to call several writes without awaiting them an dthen await last or all.
closes the stream. further operation will fail.