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)
| parameter | description |
|---|---|
| count | How many bytes to advance. |
Exceptions
| exception | condition |
|---|---|
| ObjectDisposedException | Object has been disposed. |
| ArgumentOutOfRangeException | count is negative. |
| InvalidOperationException | count 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
- class RecyclableMemoryStream
- namespace Microsoft.IO