SequenceMarshal.TryGetReadOnlyMemory(ReadOnlySequence<T>, ReadOnlyMemory<T>) SequenceMarshal.TryGetReadOnlyMemory(ReadOnlySequence<T>, ReadOnlyMemory<T>) SequenceMarshal.TryGetReadOnlyMemory(ReadOnlySequence<T>, ReadOnlyMemory<T>) SequenceMarshal.TryGetReadOnlyMemory(ReadOnlySequence<T>, ReadOnlyMemory<T>) Method

定義

指定した読み取り専用シーケンスから読み取り専用メモリの取得を試みます。Attempts to retrieve a read-only memory from the specified read-only sequence.

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

型パラメーター

T

読み取り専用シーケンスの型。The type of the read-only sequence.

パラメーター

sequence
ReadOnlySequence<T> ReadOnlySequence<T> ReadOnlySequence<T> ReadOnlySequence<T>

メモリの取得元となる読み取り専用のシーケンス。The read-only sequence from which the memory will be retrieved.

memory
ReadOnlyMemory<T> ReadOnlyMemory<T> ReadOnlyMemory<T> ReadOnlyMemory<T>

T 型で返された読み取り専用のメモリ。The returned read-only memory of type T.

戻り値

読み取り専用メモリを取得できる場合は true、それ以外の場合は falsetrue if the read-only memory can be retrieved; otherwise, false.

適用対象