Share via


UnmanagedMemoryAccessor.ReadArray<T>(Int64, T[], Int32, Int32) 方法

定義

將型別 T 的結構從存取子讀入至型別 T 的陣列。

public:
generic <typename T>
 where T : value class int ReadArray(long position, cli::array <T> ^ array, int offset, int count);
public int ReadArray<T> (long position, T[] array, int offset, int count) where T : struct;
[System.Security.SecurityCritical]
public int ReadArray<T> (long position, T[] array, int offset, int count) where T : struct;
member this.ReadArray : int64 * 'T[] * int * int -> int (requires 'T : struct)
[<System.Security.SecurityCritical>]
member this.ReadArray : int64 * 'T[] * int * int -> int (requires 'T : struct)
Public Function ReadArray(Of T As Structure) (position As Long, array As T(), offset As Integer, count As Integer) As Integer

類型參數

T

結構的型別。

參數

position
Int64

要在存取子中開始讀取的位元組數。

array
T[]

陣列,包含從存取子讀取的結構。

offset
Int32

要在 array 中放置第一個複製結構的索引。

count
Int32

要從存取子讀取之型 T 別的結構數目。

傳回

讀入至 array 的結構數目。 如果提供較少的結構,則這個值可能小於 count,如果已經到達存取子結尾,則為零。

屬性

例外狀況

array 不夠大,無法包含結構 (從 count 開始) 的 position

arraynull

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

存取子不支援讀取。

存取子已經被處置。

備註

這個方法不安全。

適用於