WebOpfsBytesFile class final
A BytesFile backed by Origin Private File System chunks.
Properties
- chunkSize → int
-
Chunk size in bytes (stored in the manifest; fixed per logical file).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
no setter
-
length
→ Future<
int> -
Current logical length in bytes.
no setter
- loadedSlot → int
-
Manifest slot this file was loaded from (
-1when newly created).no setter - manifest → WebFileManifest
-
In-memory manifest snapshot (diagnostics; does not re-read OPFS).
no setter
- path → String
-
Logical path (normalized,
/-separated).final - readOnly → bool
-
Whether writes are rejected with StateError.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storePath → String
-
OPFS path of the directory holding this file's manifest and chunks.
no setter
- supportsConcurrentReads → bool
-
Whether concurrent positional reads are safe.
no setter
Methods
-
append(
Uint8List src, {int start = 0, int? end}) → Future< int> - Appends to the end.
-
close(
) → Future< void> - Closes the file; further operations throw StateError.
-
debugChunkWorkerIndexes(
) → List< int> - Diagnostic hook for tests: which worker currently owns each open chunk.
-
debugPhysicalChunkSize(
int index) → Future< int> -
Physical size of chunk
index's OPFS file (0 when it does not exist). -
delete(
) → Future< void> - Closes and deletes the underlying file.
-
flush(
) → Future< void> - Flushes pending writes to the backing store.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readAt(
int offset, Uint8List dst, {int start = 0, int? end}) → Future< int> -
Reads into
dst[start..end)atoffset. Returns bytes read (0 at EOF). -
toString(
) → String -
A string representation of this object.
override
-
truncate(
int newLength) → Future< void> - Changes the logical length.
-
writeAt(
int offset, Uint8List src, {int start = 0, int? end}) → Future< int> -
Writes
src[start..end)atoffset. Returns bytes written.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
open(
String path, {bool create = true, bool readOnly = false, int chunkSize = kDefaultChunkSize, int? workers}) → Future< WebOpfsBytesFile> -
Opens the logical file at
path. -
readManifest(
String path) → Future< WebFileManifest?> -
Reads and decodes the newest valid manifest for
pathwithout opening the file (no sync handle is taken, so no lock is involved).
Constants
- maxOpenChunkHandles → const int
- Maximum number of chunk handles kept open per file.