NativeMmapFile class final

Wraps a native mmap file without exposing engine names to the simple API.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isClosed → bool
no setter
length → Future<int>
Current logical length in bytes.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
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.
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
readAllNative({NativeBufferPool? pool}) → Future<NativeBuffer>
Reads the whole file into a native buffer, optionally from pool.
readAt(int offset, Uint8List dst, {int start = 0, int? end}) → Future<int>
Reads into dst[start..end) at offset. Returns bytes read (0 at EOF).
readAtPointer(int offset, Pointer<Uint8> dst, int length) → int
Zero-copy read into caller-owned native memory.
readIntoNative(int offset, NativeBuffer buffer) → int
Convenience wrapper for NativeBuffer.
toString() → String
A string representation of this object.
inherited
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) at offset. Returns bytes written.
writeAtPointer(int offset, Pointer<Uint8> src, int length) → int
Zero-copy write from caller-owned native memory.
writeFromNative(int offset, NativeBuffer buffer) → int

Operators

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

Static Methods

open(String path, {bool create = true, bool readOnly = false, bool direct = false, bool largePages = false}) → Future<NativeMmapFile>