Problem in serializing

Posted by Harun on Stack Overflow See other posts from Stack Overflow or by Harun
Published on 2010-01-04T19:24:13Z Indexed on 2010/03/09 3:21 UTC
Read the original article Hit count: 220

Filed under:
|

Hello Guyz,

Presently I need to serialize one of my object which contains more my own classes object. But the problem is I dont want to save it in a file and then retrieve it into memory stream. Is there any way to directly serialize my object into stream.

I used BinaryFormatter for seializing. First I used a MemoryStream directly to take serialize output but it is giving error at time of deserialization. But later when I serialize it with a file then close it and again reopen it , it works perfectly. But I want to take it direct into stream because in my program I need to do it frequently to pass it into network client. And using file repeatedly might slow down my software.

Hope I clear my problem. Any Sugetion ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about serialize