C# – First steps with C# and .NET – part 031 .

Serialization is the process of converting an object into a stream of bytes to store the object or transmit it to memory, a database, or a file. Its main purpose is to save the state of an object in order to be able to recreate it when needed. The reverse process is called deserialization.
Through serialization, a developer can perform actions such as:

  • sending the object to a remote application by using a web service;
  • passing an object from one domain to another;
  • passing an object through a firewall as a JSON or XML string;
  • maintaining security or user-specific information across applications;

, see the official documentation.
This example uses as a basis a C # source code created in a previous tutorial and aims to use the serialization and deserialization process for the binary serialization part.

This is the simple source code in C# commented in order to see how this works.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.