UnmanagedMemoryAccessor.Initialize 方法

定義

設定存取子的初始值。

protected:
 void Initialize(System::Runtime::InteropServices::SafeBuffer ^ buffer, long offset, long capacity, System::IO::FileAccess access);
protected void Initialize (System.Runtime.InteropServices.SafeBuffer buffer, long offset, long capacity, System.IO.FileAccess access);
member this.Initialize : System.Runtime.InteropServices.SafeBuffer * int64 * int64 * System.IO.FileAccess -> unit
Protected Sub Initialize (buffer As SafeBuffer, offset As Long, capacity As Long, access As FileAccess)

參數

buffer
SafeBuffer

包含存取子的緩衝區。

offset
Int64

存取子會在此處開始的位元組。

capacity
Int64

要配置的記憶體大小 (以位元組為單位)。

access
FileAccess

允許的記憶體存取類型。 預設為 ReadWrite

例外狀況

offset 加上 capacity 大於 buffer

buffernull

offsetcapacity 小於零。

-或-

access 不是有效的 MemoryMappedFileAccess 列舉值。

offset 加上 capacity 會環繞高端的位址空間。

備註

這個類別的建構函式會呼叫這個方法。

適用於