共用方式為


SequenceMarshal.TryGetArray<T> 方法

定義

從基礎唯讀序列取得陣列區段。

public:
generic <typename T>
 static bool TryGetArray(System::Buffers::ReadOnlySequence<T> sequence, [Runtime::InteropServices::Out] ArraySegment<T> % segment);
public static bool TryGetArray<T> (System.Buffers.ReadOnlySequence<T> sequence, out ArraySegment<T> segment);
static member TryGetArray : System.Buffers.ReadOnlySequence<'T> * ArraySegment -> bool
Public Shared Function TryGetArray(Of T) (sequence As ReadOnlySequence(Of T), ByRef segment As ArraySegment(Of T)) As Boolean

類型參數

T

唯讀序列的類型。

參數

sequence
ReadOnlySequence<T>

要從中擷取陣列區段的唯讀序列。

segment
ArraySegment<T>

傳回的陣列區段。

傳回

若可以擷取陣列區段,則為 true;否則為 false 並傳回預設陣列區段。

適用於