RecyclableMemoryStream.GetReadOnlySequence method

October 6, 2021 · View on GitHub

Returns a sequence containing the contents of the stream.

public ReadOnlySequence<byte> GetReadOnlySequence()

Return Value

A ReadOnlySequence of bytes.

Exceptions

exceptioncondition
ObjectDisposedExceptionObject has been disposed.

Remarks

IMPORTANT: Calling Write(), GetMemory(), GetSpan(), Dispose(), or Close() after calling GetReadOnlySequence() invalidates the sequence.

See Also