Skip to content
Discussion options

You must be logged in to vote

Not sure if you have gotten your answer elsewhere, but if you want to keep the data after you call AdvanceTo you will need to copy it. If you use TryGetReadOnlyMemory it will give you a reference to the underlying memory that the Pipe owns. After AdvanceTo is called then the Pipe may reuse or clobber that memory.

The alternative of course is to delay the call to AdvanceTo until you are done with the memory, but that might not be possible as you are hinting.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by GF-Huang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants