UnmanagedMemoryAccessor UnmanagedMemoryAccessor UnmanagedMemoryAccessor UnmanagedMemoryAccessor Class

定義

從 Managed 程式碼對 Unmanaged 記憶體區塊提供隨機存取。Provides random access to unmanaged blocks of memory from managed code.

public ref class UnmanagedMemoryAccessor : IDisposable
public class UnmanagedMemoryAccessor : IDisposable
type UnmanagedMemoryAccessor = class
    interface IDisposable
Public Class UnmanagedMemoryAccessor
Implements IDisposable
繼承
UnmanagedMemoryAccessorUnmanagedMemoryAccessorUnmanagedMemoryAccessorUnmanagedMemoryAccessor
衍生
實作

備註

CreateViewAccessor方法的MemoryMappedFile物件會傳回 unmanaged 的記憶體對應檔案的檢視所使用的記憶體區塊。The CreateViewAccessor method of a MemoryMappedFile object returns the unmanaged blocks of memory for working with views of memory-mapped files.

注意

此類型會實作 IDisposable 介面,但實際上沒有任何要處置的資源。This type implements the IDisposable interface, but does not actually have any resources to dispose. 這表示其處置方式不一定要直接呼叫 Dispose() 或使用語言建構,例如 using (在 C# 中) 或 Using (在 Visual Basic 中)。This means that disposing it by directly calling Dispose() or by using a language construct such as using (in C#) or Using (in Visual Basic) is not necessary.

建構函式

UnmanagedMemoryAccessor() UnmanagedMemoryAccessor() UnmanagedMemoryAccessor() UnmanagedMemoryAccessor()

初始化 UnmanagedMemoryAccessor 類別的新執行個體。Initializes a new instance of the UnmanagedMemoryAccessor class.

UnmanagedMemoryAccessor(SafeBuffer, Int64, Int64) UnmanagedMemoryAccessor(SafeBuffer, Int64, Int64) UnmanagedMemoryAccessor(SafeBuffer, Int64, Int64) UnmanagedMemoryAccessor(SafeBuffer, Int64, Int64)

使用指定的緩衝區、位移和容量,初始化 UnmanagedMemoryAccessor 類別的新執行個體。Initializes a new instance of the UnmanagedMemoryAccessor class with a specified buffer, offset, and capacity.

UnmanagedMemoryAccessor(SafeBuffer, Int64, Int64, FileAccess) UnmanagedMemoryAccessor(SafeBuffer, Int64, Int64, FileAccess) UnmanagedMemoryAccessor(SafeBuffer, Int64, Int64, FileAccess) UnmanagedMemoryAccessor(SafeBuffer, Int64, Int64, FileAccess)

使用指定的緩衝區、位移、容量和存取權限,初始化 UnmanagedMemoryAccessor 類別的新執行個體。Initializes a new instance of the UnmanagedMemoryAccessor class with a specified buffer, offset, capacity, and access right.

屬性

CanRead CanRead CanRead CanRead

判斷存取子是否可讀取。Determines whether the accessor is readable.

CanWrite CanWrite CanWrite CanWrite

判斷存取子是否可寫入。Determines whether the accessory is writable.

Capacity Capacity Capacity Capacity

取得存取子的容量。Gets the capacity of the accessor.

IsOpen IsOpen IsOpen IsOpen

判斷存取子目前是否由處理程序開啟。Determines whether the accessor is currently open by a process.

方法

Dispose() Dispose() Dispose() Dispose()

釋放 UnmanagedMemoryAccessor 所使用的所有資源。Releases all resources used by the UnmanagedMemoryAccessor.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

釋放 UnmanagedMemoryAccessor 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the UnmanagedMemoryAccessor and optionally releases the managed resources.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
Initialize(SafeBuffer, Int64, Int64, FileAccess) Initialize(SafeBuffer, Int64, Int64, FileAccess) Initialize(SafeBuffer, Int64, Int64, FileAccess) Initialize(SafeBuffer, Int64, Int64, FileAccess)

設定存取子的初始值。Sets the initial values for the accessor.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
Read<T>(Int64, T) Read<T>(Int64, T) Read<T>(Int64, T) Read<T>(Int64, T)

將型別 T 的結構從存取子讀入至提供的參考。Reads a structure of type T from the accessor into a provided reference.

ReadArray<T>(Int64, T[], Int32, Int32) ReadArray<T>(Int64, T[], Int32, Int32) ReadArray<T>(Int64, T[], Int32, Int32) ReadArray<T>(Int64, T[], Int32, Int32)

將型別 T 的結構從存取子讀入至型別 T 的陣列。Reads structures of type T from the accessor into an array of type T.

ReadBoolean(Int64) ReadBoolean(Int64) ReadBoolean(Int64) ReadBoolean(Int64)

從存取子讀取布林值。Reads a Boolean value from the accessor.

ReadByte(Int64) ReadByte(Int64) ReadByte(Int64) ReadByte(Int64)

從存取子讀取位元組值。Reads a byte value from the accessor.

ReadChar(Int64) ReadChar(Int64) ReadChar(Int64) ReadChar(Int64)

從存取子讀取位元組值。Reads a character from the accessor.

ReadDecimal(Int64) ReadDecimal(Int64) ReadDecimal(Int64) ReadDecimal(Int64)

從存取子讀取位元組值。Reads a decimal value from the accessor.

ReadDouble(Int64) ReadDouble(Int64) ReadDouble(Int64) ReadDouble(Int64)

從存取子讀取雙精確度浮點數值。Reads a double-precision floating-point value from the accessor.

ReadInt16(Int64) ReadInt16(Int64) ReadInt16(Int64) ReadInt16(Int64)

從存取子讀取 16 位元整數。Reads a 16-bit integer from the accessor.

ReadInt32(Int64) ReadInt32(Int64) ReadInt32(Int64) ReadInt32(Int64)

從存取子讀取 32 位元整數。Reads a 32-bit integer from the accessor.

ReadInt64(Int64) ReadInt64(Int64) ReadInt64(Int64) ReadInt64(Int64)

從存取子讀取 64 位元整數。Reads a 64-bit integer from the accessor.

ReadSByte(Int64) ReadSByte(Int64) ReadSByte(Int64) ReadSByte(Int64)

從存取子讀取 8 位元帶正負號的整數。Reads an 8-bit signed integer from the accessor.

ReadSingle(Int64) ReadSingle(Int64) ReadSingle(Int64) ReadSingle(Int64)

從存取子讀取單精確度浮點數值。Reads a single-precision floating-point value from the accessor.

ReadUInt16(Int64) ReadUInt16(Int64) ReadUInt16(Int64) ReadUInt16(Int64)

從存取子讀取不帶正負號的 16 位元整數。Reads an unsigned 16-bit integer from the accessor.

ReadUInt32(Int64) ReadUInt32(Int64) ReadUInt32(Int64) ReadUInt32(Int64)

從存取子讀取不帶正負號的 32 位元整數。Reads an unsigned 32-bit integer from the accessor.

ReadUInt64(Int64) ReadUInt64(Int64) ReadUInt64(Int64) ReadUInt64(Int64)

從存取子讀取不帶正負號的 64 位元整數。Reads an unsigned 64-bit integer from the accessor.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
Write(Int64, Boolean) Write(Int64, Boolean) Write(Int64, Boolean) Write(Int64, Boolean)

將布林值寫入至存取子。Writes a Boolean value into the accessor.

Write(Int64, Byte) Write(Int64, Byte) Write(Int64, Byte) Write(Int64, Byte)

將位元組值寫入至存取子。Writes a byte value into the accessor.

Write(Int64, Char) Write(Int64, Char) Write(Int64, Char) Write(Int64, Char)

將字元寫入至存取子。Writes a character into the accessor.

Write(Int64, Decimal) Write(Int64, Decimal) Write(Int64, Decimal) Write(Int64, Decimal)

將十進位值寫入至存取子。Writes a decimal value into the accessor.

Write(Int64, Double) Write(Int64, Double) Write(Int64, Double) Write(Int64, Double)

Double 值寫入至存取子。Writes a Double value into the accessor.

Write(Int64, Int16) Write(Int64, Int16) Write(Int64, Int16) Write(Int64, Int16)

將 16 位元整數寫入至存取子。Writes a 16-bit integer into the accessor.

Write(Int64, Int32) Write(Int64, Int32) Write(Int64, Int32) Write(Int64, Int32)

將 32 位元整數寫入至存取子。Writes a 32-bit integer into the accessor.

Write(Int64, Int64) Write(Int64, Int64) Write(Int64, Int64) Write(Int64, Int64)

將 64 位元整數寫入至存取子。Writes a 64-bit integer into the accessor.

Write(Int64, SByte) Write(Int64, SByte) Write(Int64, SByte) Write(Int64, SByte)

將 8 位元整數寫入至存取子。Writes an 8-bit integer into the accessor.

Write(Int64, Single) Write(Int64, Single) Write(Int64, Single) Write(Int64, Single)

Single 寫入至存取子。Writes a Single into the accessor.

Write(Int64, UInt16) Write(Int64, UInt16) Write(Int64, UInt16) Write(Int64, UInt16)

將不帶正負號的 16 位元整數寫入至存取子。Writes an unsigned 16-bit integer into the accessor.

Write(Int64, UInt32) Write(Int64, UInt32) Write(Int64, UInt32) Write(Int64, UInt32)

將不帶正負號的 32 位元整數寫入至存取子。Writes an unsigned 32-bit integer into the accessor.

Write(Int64, UInt64) Write(Int64, UInt64) Write(Int64, UInt64) Write(Int64, UInt64)

將不帶正負號的 64 位元整數寫入至存取子。Writes an unsigned 64-bit integer into the accessor.

Write<T>(Int64, T) Write<T>(Int64, T) Write<T>(Int64, T) Write<T>(Int64, T)

將結構寫入至存取子。Writes a structure into the accessor.

WriteArray<T>(Int64, T[], Int32, Int32) WriteArray<T>(Int64, T[], Int32, Int32) WriteArray<T>(Int64, T[], Int32, Int32) WriteArray<T>(Int64, T[], Int32, Int32)

將結構從型別 T 的陣列寫入至存取子。Writes structures from an array of type T into the accessor.

適用於