Creates a new ByteVectorStream.
Initial content. If a Uint8Array is provided it is
wrapped in a new ByteVector. If a ByteVector is
provided a copy is made. Defaults to an empty buffer.
Resets the stream position to the beginning.
Returns a copy of the underlying ByteVector.
Inserts data at byte offset start, optionally replacing replace
bytes of existing content.
The bytes to insert.
Byte offset at which to begin the insertion.
Number of existing bytes to overwrite. Defaults to 0.
Returns true — ByteVectorStream is always open.
Returns the total number of bytes in the stream.
Returns an empty string — in-memory streams have no meaningful name.
Reads up to length bytes from the current position and advances the
position by the number of bytes actually read.
Maximum number of bytes to read.
Resolves with a ByteVector containing the bytes read.
Returns false — ByteVectorStream is always writable.
Removes length bytes beginning at byte offset start.
Byte offset of the first byte to remove.
Number of bytes to remove.
Moves the read/write position.
Number of bytes to move.
Reference point. Defaults to Position.Beginning.
Returns the current read/write position in bytes.
Truncates or zero-extends the stream to exactly length bytes. If the
current position exceeds the new length, it is clamped.
The desired stream length in bytes.
Writes data at the current position, extending the buffer if necessary,
and advances the position by data.length.
The bytes to write.
An in-memory IOStream backed by a ByteVector. Useful for reading and writing tag metadata without touching the filesystem, or for constructing binary payloads in memory.
All operations are synchronous under the hood; the async signatures exist solely to satisfy the IOStream contract.