AbstractAbstractclearResets the stream position to the beginning (equivalent to
seek(0, Position.Beginning)).
AbstractinsertInserts data at byte offset start, optionally replacing replace
bytes of existing content. The position is set to start + data.length
after the operation.
The bytes to insert.
Byte offset at which to begin the insertion.
Optionalreplace: numberNumber of existing bytes to overwrite starting at
start. Defaults to 0 (pure insertion).
AbstractisReturns true if the stream is currently open and available for I/O.
AbstractlengthReturns the total length of the stream in bytes.
AbstractnameReturns the name or identifier of the stream (e.g., a file path).
AbstractreadReads up to length bytes from the current stream position and advances
the position by the number of bytes actually read.
Maximum number of bytes to read.
A ByteVector containing the bytes read. May be shorter than
length if the end of the stream is reached.
AbstractreadReturns true if the stream does not support write operations.
AbstractremoveRemoves length bytes beginning at byte offset start, shifting all
subsequent bytes towards the beginning of the stream.
Byte offset of the first byte to remove.
Number of bytes to remove.
AbstractseekMoves the read/write position within the stream.
Number of bytes to move relative to position.
Optionalposition: PositionReference point for the seek. Defaults to Position.Beginning.
AbstracttellReturns the current read/write position in bytes from the start of the stream.
AbstracttruncateTruncates or extends the stream to exactly length bytes. If the new
length is greater than the current length, the extension is zero-filled.
If the current position exceeds the new length, it is clamped.
The desired stream length in bytes.
AbstractwriteWrites data at the current stream position, overwriting existing content
and extending the stream if necessary. Advances the position by
data.length.
The bytes to write.
Abstract base class for I/O streams. Concrete subclasses provide byte-level read/write access to a backing store (file, memory, network, etc.).
All I/O and position methods are async to support backends such as
Blob/File,FileSystemFileHandle, and the Deno native FS API where operations like seeking and querying length are genuinely asynchronous.Only identity/flag queries (name, readOnly, isOpen) remain synchronous.