C # serialization and deserialization

Source: Internet
Author: User

I. Concepts

The process of converting an object into a byte sequence is called serialization.

The process of restoring a byte sequence to an object is called deserialization.

 

Serialization, also known as serialization, is a mechanism used by the. NET runtime environment to support user-defined streaming. The objective is to make the custom object persistent by storage, or to transmit the object from one place to another.

The. NET Framework provides two serializing methods:

1. Use binaryformatter for serialization;

2. Use soapformatter for serialization;

3. Use xmlserializer for serialization.

The first method provides a simple binary data stream and some additional types of information, while the second method formats the data stream for XML storage. The third method is similar to the second method in XML format storage, it is much simpler than the second XML format (removes the extra information unique to soap ).

AvailableThe [serializable] attribute marks the class as serializable. If the elements of a class do not want to be serialized, 1 or 2 can be used.[Nonserialized] attribute to mark, 2. can be used[Xmlignore.

 

Http://jingyan.baidu.com/article/a681b0dec765473b184346d9.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.