MmapFile class abstract

A native file with random access and mmap windows.

Constructors

MmapFile()

Properties

hashCode → int
The hash code for this object.
no setterinherited
isClosed → bool
no setter
length → int
Current logical file length in bytes.
no setter
lengthAsync → Future<int>
no setter
path → String
no setter
readOnly → bool
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
usesLargePages → bool
Whether large pages are active for this file's direct-I/O scratch buffer.
no setter

Methods

adviseRead({int offset = 0, int? length}) → void
Kernel read-ahead hint for [offset, offset + length).
cloneRangeFrom(MmapFile source, {int sourceOffset = 0, int destOffset = 0, int? length}) → void
Clones extents from source into this file.
close() → void
Closes all windows, the mapping and the file handle; idempotent.
closeAsync() → Future<void>
createPlaceholder(int length) → MmapPlaceholder
Creates a reserved placeholder window that can atomically receive mapped views via MapViewOfFile3(MEM_REPLACE_PLACEHOLDER).
flush() → void
Flushes file data to the backing store.
flushAsync() → Future<void>
map({int offset = 0, int? length, bool writable = true}) → MappedRegion
Maps [offset, offset + length).
mapAsync({int offset = 0, int? length, bool writable = true}) → Future<MappedRegion>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preallocate(int length) → void
Preallocates physical space for at least length bytes.
punchHole(int offset, int length) → void
Deallocates [offset, offset + length) without writing zeros.
readAt(int offset, Uint8List dst, {int start = 0, int? end}) → int
Reads into dst[start..end) at offset; returns bytes read.
readAtAsync(int offset, Uint8List dst, {int start = 0, int? end}) → Future<int>
readAtPointer(int offset, Pointer<Uint8> dst, int length) → int
Reads into caller-owned native memory, bypassing the typed-data copy.
toString() → String
A string representation of this object.
inherited
truncate(int newLength, {bool sparse = true}) → void
Changes logical length. sparse marks the file sparse on Windows before extending, so that later far-offset writes do not zero-fill the gap.
truncateAsync(int newLength, {bool sparse = true}) → Future<void>
writeAt(int offset, Uint8List src, {int start = 0, int? end}) → int
Writes src[start..end) at offset; returns bytes written.
writeAtAsync(int offset, Uint8List src, {int start = 0, int? end}) → Future<int>
writeAtPointer(int offset, Pointer<Uint8> src, int length) → int
Writes from caller-owned native memory, bypassing the typed-data copy.
zeroize(int offset, int length) → void
Overwrites [offset, offset + length) with zeros.
zeroizeAsync(int offset, int length) → Future<void>

Operators

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