MappedFile class final

A file mapped read-only into memory by the native library. Its pages are read on first touch and stay clean, so the OS can drop them under memory pressure. Opening a path that is already mapped returns its mapping: an iOS app's address space has room for the 1.95 GB Q8 cache, but not for two copies of it. The opens are counted, each needs a release, and the last release unmaps the file.

Properties

address → Pointer<Uint8>
final
hashCode → int
The hash code for this object.
no setterinherited
length → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

bytes(int offset, int count) → Uint8List
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
release() → void
Gives back one open. After the last, the memory is gone: views of it, and GPU buffers wrapping it, must not outlive it.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

isMapped(String path) → bool
Whether path is mapped, for leak checks.
open(String path) → MappedFile?
Maps path, or returns null if it cannot be opened, is empty, or does not fit in the address space.