What is Serialization in .NET?

The serialization is the process of converting the objects into stream of bytes. they or used for transport the objects(via remoting) and persist objects(via files and databases)
When developing smaller applications that do not have a database (or other formal storage mechanism) or data that doesn’t need to be stored in a database (such as the state of a web application), you often still would like to save the data for later retrieval. There are many ways to do this, but many of them are subject to a lot of extra code (work) and extra time spent debugging. With .NET, there is now an easy way to add this functionality to your code with only a few lines of easily tested code. This easy way is called serialization. Serialization is the process of storing an object, including all of its public and private fields, to a stream.

  • Serialization is when you persist the state of an object to a storage medium so an exact copy can be re-created at a later stage.
  • Serialization is used to save session state in ASP.NET.
  • Serialization is to copy objects to the Clipboard in Windows Forms
  • Serialization is used by remoting to pass objects by value from one application domain to another.

Deserialization is the opposite – restoring an object’s field values from a stream. The stream is generally in the form of a FileStream, but does not have to be. It could be a memory stream or any other object that is of type IO.Stream. The format can be anything from XML to binary to SOAP.

Tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>