Mac Guides | Samples

MonoMac.Foundation.NSDataReadingOptions Enumeration

Flags that determine how NSData loads files.

Syntax

[System.Flags]
public enum NSDataReadingOptions

Remarks

By default NSData will loads the contents of the file in memory by allocating a block of memory and then reading the contents of the file into it.

The Mapped and MappedAlways parameter instruct NSData to use the kernel's interface to map the file into the process address space. This has a few advantages: instead of allocating read/write memory for the process, that becomes real memory usage, the mapped versions map the file into memory which means that the data is loaded on demand instead of being loaded upfront. This also allows the kernel to discard the data loaded from memory when the system is running low on memory.

Members

Member NameDescription
Coordinated
MappedUse the kernel's virtual memory map to load the file, if possible. If sucessful, this replaces read/write memory that can be very expensive with discardable memory that is backed by a file.
MappedAlwaysForce NSData to try to use the kernel's mapping support to load the file. If sucessful, this replaces read/write memory that can be very expensive with discardable memory that is backed by a file.
UncachedNotify the kernel that it should not try to cache the contents of this file in its buffer cache.

Requirements

Namespace: MonoMac.Foundation
Assembly: XamMac (in XamMac.dll)
Assembly Versions: 0.0.0.0

The members of MonoMac.Foundation.NSDataReadingOptions are listed below.

See Also: Enum

Public Fields

CoordinatedNSDataReadingOptions.
MappedNSDataReadingOptions. Use the kernel's virtual memory map to load the file, if possible. If sucessful, this replaces read/write memory that can be very expensive with discardable memory that is backed by a file.
MappedAlwaysNSDataReadingOptions. Force NSData to try to use the kernel's mapping support to load the file. If sucessful, this replaces read/write memory that can be very expensive with discardable memory that is backed by a file.
UncachedNSDataReadingOptions. Notify the kernel that it should not try to cache the contents of this file in its buffer cache.