Reset or Clear .NET MemoryStream

Posted by roygbiv on Stack Overflow See other posts from Stack Overflow or by roygbiv
Published on 2010-03-17T13:09:15Z Indexed on 2010/03/17 13:11 UTC
Read the original article Hit count: 395

Filed under:
|

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.SeekOrigin.Begin)
ms.SetLength(0)

What is the proper way to clear or reset an existing .NET MemoryStream?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about memorystream