DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="5.3.1" />

.NET API 500,632 bytes

 ReadOnlySequencePartitioner

public static class ReadOnlySequencePartitioner
Represents factory of Partitioner<T> objects for ReadOnlySequence<T>.
using System; using System.Buffers; using System.Collections.Concurrent; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace DotNext.Buffers { public static class ReadOnlySequencePartitioner { [NullableContext(1)] public static OrderablePartitioner<T> CreatePartitioner<[Nullable(2)] T>([In] [IsReadOnly] [Nullable(new byte[] { 0, 1 })] ref ReadOnlySequence<T> sequence, bool splitOnSegments = false) { if (!sequence.IsEmpty) return new <ReadOnlySequencePartitioner>FA5A04BD7618CE30B97F04847754DD7EBF2DA2B6EEA6CD97C23E6BF9FD645D192__ReadOnlySequencePartitioner<T>(ref sequence, splitOnSegments); return Partitioner.Create(Array.Empty<T>(), splitOnSegments); } } }