Skip to content

ArrayExtensions.CreateWrappedSequence Method ​

Definition ​

Creates a ReadOnlySequence<T> that wraps an array, starting at the specified index. The sequence contains two segments covering the same underlying memory, allowing sequential reading that wraps around the starting position.

c#
public static ReadOnlySequence<T> CreateWrappedSequence<T>(this T[] array, int startIndex = 0);

View source

Type Parameters ​

NameDescription
TThe type of elements in the array.

Parameters ​

NameTypeDescription
arrayT[]The array to wrap.
startIndexInt32The zero-based index to start from.

Returns ​

ReadOnlySequence<T>

A ReadOnlySequence<T> wrapping the array.