UnmanagedMemoryAccessor.Read<T>(Int64, T) 方法

定義

將型別 T 的結構從存取子讀入至提供的參考。

public:
generic <typename T>
 where T : value class void Read(long position, [Runtime::InteropServices::Out] T % structure);
public void Read<T> (long position, out T structure) where T : struct;
[System.Security.SecurityCritical]
public void Read<T> (long position, out T structure) where T : struct;
member this.Read : int64 * 'T -> unit (requires 'T : struct)
[<System.Security.SecurityCritical>]
member this.Read : int64 * 'T -> unit (requires 'T : struct)
Public Sub Read(Of T As Structure) (position As Long, ByRef structure As T)

類型參數

T

結構的型別。

參數

position
Int64

要在存取子中開始讀取的位置。

structure
T

包含讀取資料的結構。

屬性

例外狀況

position 之後沒有足夠的位元組可讀取型別 T 的結構。

-或-

T 是包含一個或多個參考型別的實值型別。

position 小於零或大於這個存取子的容量。

存取子不支援讀取。

存取子已經被處置。

備註

使用這個方法可讀取此類別中其他讀取方法無法輕易容納的中型到大型結構。

適用於