Binary deserialize a custom object in C#

Posted by Poster under C# category on | Views : 5527
To binary deserialize a custom object in C#, use following code snippet

private object BinaryDeSerializeAnObject(Stream stream)
object obj = null;
// Construct a binary formatter
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();

// Deserialize the stream into object
obj = formatter.Deserialize(stream);

return obj;

Call above method like



Comments or Responses

Login to post response