ArraySegment<T> Constructor (T[])

July 28, 2014

Initializes a new instance of the ArraySegment<T> structure that delimits all the elements in the specified array.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public ArraySegment(
	T[] array
)

Parameters

array
Type: T []
The array to wrap.

ExceptionCondition
ArgumentNullException

array is null.

This constructor creates an ArraySegment<T> that delimits all the elements of array. That is, the Offset property of the ArraySegment<T> is 0 and its Count property is the length of array. To create an ArraySegment<T> that delimits only part of an array, use the ArraySegment<T>(T[], Int32, Int32) constructor.

The original array must be one-dimensional and must have zero-based indexing.

Multiple ArraySegment<T> instances can refer to the same original array and can overlap.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft