SequenceMarshal.TryGetReadOnlySequenceSegment<T> 方法

定义

尝试检索指定的只读序列中的只读序列段。

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

类型参数

T

只读序列的类型。

参数

sequence
ReadOnlySequence<T>

从中检索只读序列段的只读序列。

startSegment
ReadOnlySequenceSegment<T>

只读序列段的开头。

startIndex
Int32

初始位置。

endSegment
ReadOnlySequenceSegment<T>

只读序列段的结尾。

endIndex
Int32

最终位置。

返回

如果可以检索只读序列段,则为 true;否则为 false

适用于