Editar

Partilhar via


ReadOnlyMemory<T> Constructors

Definition

Overloads

ReadOnlyMemory<T>(T[])

Creates a new memory region over the entirety of the target array.

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[])

Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs

Creates a new memory region over the entirety of the target array.

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

Parameters

array
T[]

The target array.

Exceptions

array is covariant, and the type of array is not exactly T[].

Remarks

Returns default when array is null.

Applies to

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

Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs

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);
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)

Parameters

array
T[]

The target array.

start
Int32

The index at which to begin the memory region.

length
Int32

The number of items in the memory region.

Exceptions

array is covariant, and the type of array is not exactly T[].

start, length, or start + length identify a position outside the range of the array.

Remarks

Returns default when array is null.

Applies to