RecyclableMemoryStream.Advance method

October 6, 2021 · View on GitHub

Notifies the stream that count bytes were written to the buffer returned by GetMemory or GetSpan. Seeks forward by count bytes.

public void Advance(int count)
parameterdescription
countHow many bytes to advance.

Exceptions

exceptioncondition
ObjectDisposedExceptionObject has been disposed.
ArgumentOutOfRangeExceptioncount is negative.
InvalidOperationExceptioncount is larger than the size of the previously requested buffer.

Remarks

You must request a new buffer after calling Advance to continue writing more data and cannot write to a previously acquired buffer.

See Also