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.

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

View source

Type Parameters

Name Description
T The type of elements in the array.

Parameters

Name Type Description
array T[] The array to wrap.
startIndex Int32 The zero-based index to start from.

Returns

ReadOnlySequence<T>

A ReadOnlySequence<T> wrapping the array.