ReadOnlyMemory<T> ReadOnlyMemory<T> ReadOnlyMemory<T> ReadOnlyMemory<T> Constructors

定义

重载

ReadOnlyMemory<T>(T[]) ReadOnlyMemory<T>(T[]) ReadOnlyMemory<T>(T[]) ReadOnlyMemory<T>(T[])

在整个目标数组上创建新的内存区域。Creates a new memory region over the entirety of the target array.

ReadOnlyMemory<T>(T[], Int32, Int32) ReadOnlyMemory<T>(T[], Int32, Int32) ReadOnlyMemory<T>(T[], Int32, Int32) ReadOnlyMemory<T>(T[], Int32, Int32)

在目标数组的一部分上创建新的内存区域,从指定位置开始并包含指定数量的元素。Creates a new memory region over the portion of the target array beginning at a specified position and including a specified number of elements.

ReadOnlyMemory<T>(T[]) ReadOnlyMemory<T>(T[]) ReadOnlyMemory<T>(T[]) ReadOnlyMemory<T>(T[])

在整个目标数组上创建新的内存区域。Creates a new memory region over the entirety of the target array.

public:
 ReadOnlyMemory(cli::array <T> ^ array);
public ReadOnlyMemory (T[] array);
new ReadOnlyMemory<'T> : 'T[] -> ReadOnlyMemory<'T>
Public Sub New (array As T())

参数

array
T[]

目标数组。The target array.

异常

array 是协变的,数组的类型并不完全是 T[]array is covariant, and the type of array is not exactly T[].

注解

当为array defaultnull返回。Returns default when array is null.

ReadOnlyMemory<T>(T[], Int32, Int32) ReadOnlyMemory<T>(T[], Int32, Int32) ReadOnlyMemory<T>(T[], Int32, Int32) ReadOnlyMemory<T>(T[], Int32, Int32)

在目标数组的一部分上创建新的内存区域,从指定位置开始并包含指定数量的元素。Creates a new memory region over the portion of the target array beginning at a specified position and including a specified number of elements.

public:
 ReadOnlyMemory(cli::array <T> ^ array, int start, int length);
public ReadOnlyMemory (T[] array, int start, int length);
new ReadOnlyMemory<'T> : 'T[] * int * int -> ReadOnlyMemory<'T>
Public Sub New (array As T(), start As Integer, length As Integer)

参数

array
T[]

目标数组。The target array.

start
Int32 Int32 Int32 Int32

开始内存区域的索引。The index at which to begin the memory region.

length
Int32 Int32 Int32 Int32

内存区域中的项数。The number of items in the memory region.

异常

array 是协变的,数组的类型并不完全是 T[]array is covariant, and the type of array is not exactly T[].

startlengthstart + length 确定数组范围之外的位置。start, length, or start + length identify a position outside the range of the array.

注解

当为array defaultnull返回。Returns default when array is null.

适用于