System::Buffers::ReadOnlySequence::TryGet method

ReadOnlySequence::TryGet method

Retrieves the memory block that contains the given position.

bool System::Buffers::ReadOnlySequence<T>::TryGet(SequencePosition &position, ReadOnlyMemory<T> &memory, bool advance) const
ParameterTypeDescription
positionSequencePosition&On input, a position identifying a segment. On output, updated to the position of the first element of the next segment (if advance is true), or left at the end of the returned memory otherwise.
memoryReadOnlyMemory<T>&When this method returns, contains the memory block starting at the given position.
advanceboolTrue to advance the position to the next segment after reading.

ReturnValue

True if a segment was found and memory was populated; otherwise, false.

See Also