Bewerken

Delen via


SequenceMarshal.TryGetReadOnlySequenceSegment<T> Method

Definition

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

public:
generic <typename T>
 static bool TryGetReadOnlySequenceSegment(System::Buffers::ReadOnlySequence<T> sequence, [Runtime::InteropServices::Out] System::Buffers::ReadOnlySequenceSegment<T> ^ % startSegment, [Runtime::InteropServices::Out] int % startIndex, [Runtime::InteropServices::Out] System::Buffers::ReadOnlySequenceSegment<T> ^ % endSegment, [Runtime::InteropServices::Out] int % endIndex);
public static bool TryGetReadOnlySequenceSegment<T> (System.Buffers.ReadOnlySequence<T> sequence, out System.Buffers.ReadOnlySequenceSegment<T>? startSegment, out int startIndex, out System.Buffers.ReadOnlySequenceSegment<T>? endSegment, out int endIndex);
public static bool TryGetReadOnlySequenceSegment<T> (System.Buffers.ReadOnlySequence<T> sequence, out System.Buffers.ReadOnlySequenceSegment<T> startSegment, out int startIndex, out System.Buffers.ReadOnlySequenceSegment<T> endSegment, out int endIndex);
static member TryGetReadOnlySequenceSegment : System.Buffers.ReadOnlySequence<'T> * ReadOnlySequenceSegment * int * ReadOnlySequenceSegment * int -> bool
Public Shared Function TryGetReadOnlySequenceSegment(Of T) (sequence As ReadOnlySequence(Of T), ByRef startSegment As ReadOnlySequenceSegment(Of T), ByRef startIndex As Integer, ByRef endSegment As ReadOnlySequenceSegment(Of T), ByRef endIndex As Integer) As Boolean

Type Parameters

T

The type of the read-only sequence.

Parameters

sequence
ReadOnlySequence<T>

The read-only sequence from which the read-only sequence segment will be retrieved.

startSegment
ReadOnlySequenceSegment<T>

The beginning read-only sequence segment.

startIndex
Int32

The initial position.

endSegment
ReadOnlySequenceSegment<T>

The ending read-only sequence segment.

endIndex
Int32

The final position.

Returns

true if the read-only sequence segment can be retrieved; otherwise, false.

Applies to