Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

UnmanagedMemoryAccessor Class

Provides random access to unmanaged blocks of memory from managed code.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)
public class UnmanagedMemoryAccessor : IDisposable

The UnmanagedMemoryAccessor type exposes the following members.

  NameDescription
Protected methodUnmanagedMemoryAccessor()Initializes a new instance of the UnmanagedMemoryAccessor class.
Public methodUnmanagedMemoryAccessor(SafeBuffer, Int64, Int64)Initializes a new instance of the UnmanagedMemoryAccessor class with a specified buffer, offset, and capacity.
Public methodUnmanagedMemoryAccessor(SafeBuffer, Int64, Int64, FileAccess)Initializes a new instance of the UnmanagedMemoryAccessor class with a specified buffer, offset, capacity, and access right.
Top
  NameDescription
Public propertyCanReadDetermines whether the accessor is readable.
Public propertyCanWriteDetermines whether the accessory is writable.
Public propertyCapacityGets the capacity of the accessor.
Protected propertyIsOpenDetermines whether the accessor is currently open by a process.
Top
  NameDescription
Public methodDispose()Releases all resources used by the UnmanagedMemoryAccessor.
Protected methodDispose(Boolean)Releases the unmanaged resources used by the UnmanagedMemoryAccessor and optionally releases the managed resources.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodInitializeSets the initial values for the accessor.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRead<T>Reads a structure of type T from the accessor into a provided reference.
Public methodReadArray<T>Reads structures of type T from the accessor into an array of type T.
Public methodReadBooleanReads a Boolean value from the accessor.
Public methodReadByteReads a byte value from the accessor.
Public methodReadCharReads a character from the accessor.
Public methodReadDecimalReads a decimal value from the accessor.
Public methodReadDoubleReads a double-precision floating-point value from the accessor.
Public methodReadInt16Reads a 16-bit integer from the accessor.
Public methodReadInt32Reads a 32-bit integer from the accessor.
Public methodReadInt64Reads a 64-bit integer from the accessor.
Public methodReadSByteReads an 8-bit signed integer from the accessor.
Public methodReadSingleReads a single-precision floating-point value from the accessor.
Public methodReadUInt16Reads an unsigned 16-bit integer from the accessor.
Public methodReadUInt32Reads an unsigned 32-bit integer from the accessor.
Public methodReadUInt64Reads an unsigned 64-bit integer from the accessor.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodWrite(Int64, Boolean)Writes a Boolean value into the accessor.
Public methodWrite(Int64, Byte)Writes a byte value into the accessor.
Public methodWrite(Int64, Char)Writes a character into the accessor.
Public methodWrite(Int64, Decimal)Writes a decimal value into the accessor.
Public methodWrite(Int64, Double)Writes a Double value into the accessor.
Public methodWrite(Int64, Int16)Writes a 16-bit integer into the accessor.
Public methodWrite(Int64, Int32)Writes a 32-bit integer into the accessor.
Public methodWrite(Int64, Int64)Writes a 64-bit integer into the accessor.
Public methodWrite(Int64, SByte)Writes an 8-bit integer into the accessor.
Public methodWrite(Int64, Single)Writes a Single into the accessor.
Public methodWrite(Int64, UInt16)Writes an unsigned 16-bit integer into the accessor.
Public methodWrite(Int64, UInt32)Writes an unsigned 32-bit integer into the accessor.
Public methodWrite(Int64, UInt64)Writes an unsigned 64-bit integer into the accessor.
Public methodWrite<T>(Int64, T)Writes a structure into the accessor.
Public methodWriteArray<T>Writes structures from an array of type T into the accessor.
Top

The CreateViewAccessor method of a MemoryMappedFile object returns the unmanaged blocks of memory for working with views of memory-mapped files.

Important noteImportant

This type implements the IDisposable interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its Dispose method in a try/catch block. To dispose of it indirectly, use a language construct such as using (in C#) or Using (in Visual Basic). For more information, see the “Using an Object that Implements IDisposable” section in the IDisposable interface topic.

.NET Framework

Supported in: 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.