This documentation is archived and is not being maintained.

ArraySegment(T) Structure

Delimits a section of a one-dimensional array.

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

[<Sealed>]
[<SerializableAttribute>]
type ArraySegment<'T> =  struct end

Type Parameters

T

The type of the elements in the array segment.

The ArraySegment(T) type exposes the following members.

  NameDescription
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryArraySegment(T)(T[])Initializes a new instance of the ArraySegment(T) structure that delimits all the elements in the specified array.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryArraySegment(T)(T[], Int32, Int32)Initializes a new instance of the ArraySegment(T) structure that delimits the specified range of the elements in the specified array.
Top

  NameDescription
Public propertySupported by the XNA FrameworkSupported by Portable Class LibraryArrayGets the original array containing the range of elements that the array segment delimits.
Public propertySupported by the XNA FrameworkSupported by Portable Class LibraryCountGets the number of elements in the range delimited by the array segment.
Public propertySupported by the XNA FrameworkSupported by Portable Class LibraryOffsetGets the position of the first element in the range delimited by the array segment, relative to the start of the original array.
Top

  NameDescription
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryEquals(ArraySegment(T))Determines whether the specified ArraySegment(T) structure is equal to the current instance.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryEquals(Object)Determines whether the specified object is equal to the current instance. (Overrides ValueType.Equals(Object).)
Protected methodSupported by the XNA FrameworkSupported by Portable Class LibraryFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetHashCodeReturns the hash code for the current instance. (Overrides ValueType.GetHashCode().)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkSupported by Portable Class LibraryMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryToStringReturns the fully qualified type name of this instance. (Inherited from ValueType.)

In XNA Framework 3.0, this member is inherited from Object.ToString().


In Portable Class Library Portable Class Library, this member is inherited from Object.ToString().
Top

  NameDescription
Public operatorStatic memberSupported by the XNA FrameworkSupported by Portable Class LibraryEqualityIndicates whether two ArraySegment(T) structures are equal.
Public operatorStatic memberSupported by the XNA FrameworkSupported by Portable Class LibraryInequalityIndicates whether two ArraySegment(T) structures are unequal.
Top

ArraySegment(T) is a wrapper around an array that delimits a range of elements in that array. Multiple ArraySegment(T) instances can refer to the same original array and can overlap.

The Array property returns the entire original array, not a copy of the array; therefore, changes made to the array returned by the Array property are made to the original array.

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

The following code example passes an ArraySegment(T) structure to a method.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: