Serialization/deserialization of JAVA

1. Concept

1.1 Serialization:

        The process of converting a data structure or object into binary data.

1.2 Deserialization:

        The process of restoring the binary data generated by the serialization process to a data structure or.        

(Persistence: the process of storing data structures or objects).

2. Examples

3. Serialization implementation scheme:

3.1 serialiable (java serialization scheme)

3.2 parcelabe (android only)

3.3 json, sml, protbuf. . . (serialization scheme in a broad sense)

4. Purpose and scenario:

4.1 For data transfer:

        The transmission here includes Wanluo transmission, inter-process communication, etc.

4.2 Save for data persistence

        Convert the object into a byte stream and store it on the hard disk. When the JVM shuts down, the byte stream will still wait silently on the hard disk, waiting for the next JVM startup, and deserialize the serialized object into the original object. And the serialized binary sequence can reduce storage space (permanently save objects).

Guess you like

Origin blog.csdn.net/set_one_name/article/details/127180590