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

定义

T 类型的结构从访问器读取到 T 类型的数组中。

C#
public int ReadArray<T> (long position, T[] array, int offset, int count) where T : struct;
C#
[System.Security.SecurityCritical]
public int ReadArray<T> (long position, T[] array, int offset, int count) where T : struct;

类型参数

T

结构的类型。

参数

position
Int64

访问器中的字节偏移量,从此处开始读取。

array
T[]

包含从访问器读取的结构的数组。

offset
Int32

array 中要将第一个复制的结构放置到的索引。

count
Int32

要从访问器中读取的类型 T 的结构数。

返回

读入 array 的结构数。 如果可用结构较少,则此值可能小于 count;如果到达访问器末尾,则为零。

属性

例外

array 不足够大,无法包含结构的 count(从 position 开始)。

arraynull

position 小于零或大于访问器的容量。

访问器不支持读取。

已释放访问器。

注解

此方法不安全。

适用于

产品 版本
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1