Resets the stream position to the beginning.
Flushes pending writes and closes the underlying sync access handle. This is a no-op in read-only mode (the blob requires no cleanup).
After calling close(), isOpen returns false and further I/O
will produce undefined behaviour.
Inserts data at byte offset start, optionally replacing replace
bytes of existing content.
Because FileSystemSyncAccessHandle does not support in-place insertion,
this method reads the tail of the file, writes the new data, then writes
the tail back.
The bytes to insert.
Byte offset at which to begin the insertion.
Number of existing bytes to overwrite. Defaults to 0.
Returns true if the stream has not yet been closed.
Returns the total length of the file in bytes.
Returns the name of the underlying file.
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 true if this stream was opened in read-only mode.
Moves the read/write position within the stream.
Number of bytes to move relative to position.
Reference point for the seek. Defaults to Position.Beginning.
Returns the current read/write position in bytes.
Writes data at the current position, extending the file if necessary,
and advances the position by data.length.
The bytes to write.
StaticopenOpens a FileSystemFileHandle and wraps it in a stream.
The handle to open. Must be obtained via the File
System Access API (e.g. window.showOpenFilePicker()).
When true, the stream opens the handle's File blob
for read-only slice-based access instead of creating a sync handle.
Defaults to false.
A fully initialised FileSystemFileHandleStream.
A read/write IOStream backed by a
FileSystemFileHandlefrom the browser's File System Access API.Read-write mode (default): opens a
FileSystemSyncAccessHandleand uses itsread/writemethods with explicit byte offsets (atoption) so that the internal cursor stays in sync without extra round-trips.Read-only mode: retrieves the underlying
Fileblob from the handle and performs lazy slice-based reads — identical to BlobStream but named after the originatingFileSystemFileHandle.The constructor is private; always use the async factory:
Example