Peter,
No, you can't, but you can get the contents of the MemoryStream before
the BinaryWriter is finished by calling ToArray on the MemoryStream. You
can then pass this to a new MemoryStream when you want to use it in a
BinaryReader again.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Peter Morris" <su*****@NOdroopySPAMeyes.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
Can I use a BinaryWriter without it closing the underlying stream?
I want to save information to a MemoryStream using a BinaryWriter but I
want to dispose of the BinaryWriter and keep the MemoryStream in case I
wish to reload information from the MemoryStream using BinaryReader.
Thanks
Pete