StorageFile class abstract interface

Minimal file abstraction used by the write-ahead log.

Deliberately narrow: the log needs append, positional read, truncate and flush, nothing else. Segments and manifests will use different interfaces, because an append log and an immutable object have different failure modes.

Implementations must guarantee that readAt returns exactly length bytes (throwing otherwise) and that truncate never extends the file.

Implementers

Properties

hashCode → int
The hash code for this object.
no setterinherited
length → Future<int>
Current logical length in bytes.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

append(Uint8List bytes) → Future<void>
Appends bytes at the end of the file.
close() → Future<void>
Releases the file. Subsequent operations throw StateError.
flush() → Future<void>
Makes previously appended bytes durable.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readAt(int offset, int length) → Future<Uint8List>
Reads exactly length bytes starting at offset.
toString() → String
A string representation of this object.
inherited
truncate(int length) → Future<void>
Cuts the file to length bytes. Must not extend.

Operators

operator ==(Object other) → bool
The equality operator.
inherited