Flushes and finalizes the stream. Finalize has to be called on certain types of streams. No writes are possible after a call to finalize().
Flushes the stream and makes sure that all data is being written to the output device.
Returns a temporary reference to the data that is currently buffered. The returned slice typically has the size leastSize() or 0 if dataAvailableForRead() returns false. Streams that don't have an internal buffer will always return an empty slice. Note that any method invocation on the same stream potentially invalidates the contents of the returned buffer.
Fills the preallocated array 'bytes' with data from the stream.
Writes an array of bytes to the stream.
Not implemented.
Queries if there is data available for immediate, non-blocking read.
Returns true iff the end of the input stream has been reached.
Returns the maximum number of bytes that are known to remain in this stream until the end is reached. After leastSize() bytes have been read, the stream will either have reached EOS and empty() returns true, or leastSize() returns again a number > 0.
Wraps a normal Stream to add encryption based on the Noise_XX_25519_ChaChaPoly_BLAKE2b protocol.