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);
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
A ReadOnlySequence<T> wrapping the array.