Serialization is the process of converting an object into stream of bytes that can be stored and transmitted over network. We can store this data into a file, database or Cache object. De-Serialization is the reverse process of serialization. By using de-serialization we can get the original object that is previously serialized. Following are the important namespaces for Serialization in .NET.
- System.Runtime.Serialization namespace.
- System.Runtime.Serialization.Formatters.Binary
- System.Xml.Serialization
The main advantage of serialization is that we can transmit data across the network in a cross-platform environment and we can save in a persistent or non-persistent storage medium. Serialization can be the following types:
- Binary Serialization
- SOAP Serialization
- XML Serialization
- Custom Serialization