Closed
Description
I suggest to add ReadOnlySequence constructor for ArraySegment.
Proposed API
public readonly partial struct ReadOnlySequence<T>
{
/// <summary>
/// Creates an instance of <see cref="ReadOnlySequence{T}"/> from the <see cref="ArraySegment{T}"/>.
/// </summary>
public ReadOnlySequence(ArraySegment<T> arraySegment);
}
Details
Now we have three types for buffers: Array, ArraySegment, Memory. ReadOnlySequence have constructor for two of them, so it seems convenient to have constructor for ArraySegment too.
It is just sugar for public ReadOnlySequence(T[] array, int start, int length); constructor for ArraySegment.
Activity