Provides memory mapping of files for high-speed I/O.

Static methods

@:value({ writable : false })staticopen(path:String, size:Int, writable:Bool = false):MemoryMap

Opens a file for memory mapping.

Parameters:

path

Path to the file.

size

Size of the mapping in bytes.

writable

True to map with write access.

Returns:

A MemoryMap instance if successful, null otherwise.

Variables

read onlyaddress:Int64

Returns the raw memory address of the mapping.

Methods

close():Void

Closes the memory mapping.

flush():Void

Flushes changes to disk.

read(offset:Int, length:Int):Bytes

Reads data from the memory mapping.

write(offset:Int, bytes:Bytes):Int

Writes data to the memory mapping.