Reset or Clear .NET MemoryStream

后端 未结 4 659
悲&欢浪女
悲&欢浪女 2020-12-30 18:45

The .NET MemoryStream does not appear to have a .Reset or .Clear method.

I was thinking of using the following code to accomplish this:

ms.Seek(0, IO         


        
4条回答
  •  隐瞒了意图╮
    2020-12-30 19:06

    Why do you need resetting memory stream? You always can create a new one. Or you can use:

    memoryStream.SetLength(0);
    

提交回复
热议问题