SequenceMarshal Class

Definition

Provides a collection of methods for interoperating with ReadOnlySequence<T>.

C#
public static class SequenceMarshal
Inheritance
SequenceMarshal

Methods

TryGetArray<T>(ReadOnlySequence<T>, ArraySegment<T>)

Gets an array segment from the underlying read-only sequence.

TryGetReadOnlyMemory<T>(ReadOnlySequence<T>, ReadOnlyMemory<T>)

Attempts to retrieve a read-only memory from the specified read-only sequence.

TryGetReadOnlySequenceSegment<T>(ReadOnlySequence<T>, ReadOnlySequenceSegment<T>, Int32, ReadOnlySequenceSegment<T>, Int32)

Attempts to retrieve a read-only sequence segment from the specified read-only sequence.

TryRead<T>(SequenceReader<Byte>, T)

Attempts to read the specified type out of the buffer. It's dangerous to use this method with arbitrary structs - see remarks for more information.

Applies to

Product Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1