Google News
logo
C# - Interview Questions
What is Serialization in C#?
Serialization is a process of converting code to its binary format. Once it is converted to bytes, it can be easily stored and written to a disk or any such storage devices. Serializations are mainly useful when we do not want to lose the original form of the code and it can be retrieved anytime in the future.
 
Any class which is marked with the attribute [Serializable] will be converted to its binary form.
 
The reverse process of getting the C# code back from the binary form is called Deserialization.
 
To Serialize an object we need the object to be serialized, a stream that can contain the serialized object and namespace System.Runtime.Serialization can contain classes for serialization.
Advertisement