You are on page 1of 2

Serialization

Serialization is the process of converting complex objects into stream of bytes for store it to memory, a database, or a file.

Deserialization
Deserialization is its reverse process, which is unpacking stream of bytes to their original form.

Uses for Serialization


Serialization allows the developer to save the state of an object and recreate it as needed, providing storage of objects as well as data exchange. Through serialization, a developer can perform actions like sending the object to a remote application by means of a Web Service, passing an object from one domain to another, passing an object through a firewall as an XML string, or maintaining security or user-specific information across applications. There are three formats of serialization Binary Serialization SOAP Serialization XML Serialization : : : Light and compact used in Remoting interoperable use SOAP and used in web Services Custom Serialization

Here are the following steps that we are going to do to create a serializable class and test it. Create a custom class named Employee and assign properties. Define the serialization functions. Create a main class and instantiate our Employee class. Serialize the object to a sample file. Deserialize the values by reading it from the file.

You might also like