Serialization and deserialization

 C# Serialization

  • In C#, serialization is the process of converting the object into byte stream so that it can be saved to memory, file or database. The reverse process of serialization is called deserialization.

C# SerializableAttribute

  • To serialize the object, you need to apply the SerializableAttribute attribute to the type. If you don't apply the SerializableAttribute attribute to the type, SerializationException exception is thrown at runtime.






C# Deserialization

In C# programming, deserialization is the reverse process of serialization. It means you can read the object from the byte stream. Here, we are going to use BinaryFormatter.Deserialize(stream) method to deserialize the stream.












Comments

Popular posts from this blog

Asp.Net Validation

Fundamental of OOPS From Scratch to End