This topic has not yet been rated - Rate this topic

UnmanagedMemoryAccessor Class

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

System.Object
  System.IO.UnmanagedMemoryAccessor
    System.IO.MemoryMappedFiles.MemoryMappedViewAccessor

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

The UnmanagedMemoryAccessor type exposes the following members.

  Name Description
Protected method UnmanagedMemoryAccessor() Initializes a new instance of the UnmanagedMemoryAccessor class.
Public method UnmanagedMemoryAccessor(SafeBuffer, Int64, Int64) Initializes a new instance of the UnmanagedMemoryAccessor class with a specified buffer, offset, and capacity.
Public method UnmanagedMemoryAccessor(SafeBuffer, Int64, Int64, FileAccess) Initializes a new instance of the UnmanagedMemoryAccessor class with a specified buffer, offset, capacity, and access right.
Top
  Name Description
Public property CanRead Determines whether the accessor is readable.
Public property CanWrite Determines whether the accessory is writable.
Public property Capacity Gets the capacity of the accessor.
Protected property IsOpen Determines whether the accessor is currently open by a process.
Top
  Name Description
Public method Dispose() Releases all resources used by the UnmanagedMemoryAccessor.
Protected method Dispose(Boolean) Releases the unmanaged resources used by the UnmanagedMemoryAccessor and optionally releases the managed resources.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method Initialize Sets the initial values for the accessor.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Read<T> Reads a structure of type T from the accessor into a provided reference.
Public method ReadArray<T> Reads structures of type T from the accessor into an array of type T.
Public method ReadBoolean Reads a Boolean value from the accessor.
Public method ReadByte Reads a byte value from the accessor.
Public method ReadChar Reads a character from the accessor.
Public method ReadDecimal Reads a decimal value from the accessor.
Public method ReadDouble Reads a double-precision floating-point value from the accessor.
Public method ReadInt16 Reads a 16-bit integer from the accessor.
Public method ReadInt32 Reads a 32-bit integer from the accessor.
Public method ReadInt64 Reads a 64-bit integer from the accessor.
Public method ReadSByte Reads an 8-bit signed integer from the accessor.
Public method ReadSingle Reads a single-precision floating-point value from the accessor.
Public method ReadUInt16 Reads an unsigned 16-bit integer from the accessor.
Public method ReadUInt32 Reads an unsigned 32-bit integer from the accessor.
Public method ReadUInt64 Reads an unsigned 64-bit integer from the accessor.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Write(Int64, Boolean) Writes a Boolean value into the accessor.
Public method Write(Int64, Byte) Writes a byte value into the accessor.
Public method Write(Int64, Char) Writes a character into the accessor.
Public method Write(Int64, Decimal) Writes a decimal value into the accessor.
Public method Write(Int64, Double) Writes a Double value into the accessor.
Public method Write(Int64, Int16) Writes a 16-bit integer into the accessor.
Public method Write(Int64, Int32) Writes a 32-bit integer into the accessor.
Public method Write(Int64, Int64) Writes a 64-bit integer into the accessor.
Public method Write(Int64, SByte) Writes an 8-bit integer into the accessor.
Public method Write(Int64, Single) Writes a Single into the accessor.
Public method Write(Int64, UInt16) Writes an unsigned 16-bit integer into the accessor.
Public method Write(Int64, UInt32) Writes an unsigned 32-bit integer into the accessor.
Public method Write(Int64, UInt64) Writes an unsigned 64-bit integer into the accessor.
Public method Write<T>(Int64, T) Writes a structure into the accessor.
Public method WriteArray<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.

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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)
Community Content Add
Annotations FAQ