Create a memory stream; retain data by reference if supplied, so reads observe subsequent byte modifications.
dataOptionalReturn the byte length of the memory data, or undefined if not open.
Retain data by reference and reset the read position to zero without copying bytes.
dataRead into destination and advance the position; return the byte count, 0n at the end of the stream, or undefined if not open.
destinationSet a non-negative byte position, clamped to the end of the stream; return the actual position, or undefined if not open.
positionReturn the current byte position, or undefined if not open.
Retains the supplied bytes without copying them.