Serialization: serialization is the process of converting an object into a format that is easy to transmit. For example, you can serialize an object and Use http to transmit the object between the client and the server over the Internet. At the other end, deserialization reconstructs the object from the stream.
Is a permanent object mechanism.
Specifically, it should be object serialization. Generally, objects are generated when a program is running. These objects disappear as the program stops running, but if we want to put some objects (because they are objects, so they have different features). After the program stops running, these objects still exist and can be read when the program runs again, or use these stored objects in other programs. In this case, Object serialization is required.
Only serialized objects can be stored on storage devices. The interface to be inherited for Object serialization is only a symbolic interface. That is to say, inheriting this interface indicates that this object can be serialized and has no other purpose. Object serialization is required because sometimes objects need to be transmitted over the network. During transmission, the serialized objects need to be taken out from the server hard disk and uploaded to the client through the network, then, the client reads the serialized object into the memory and performs corresponding processing.
Object serialization is a feature of Java. Through this feature, an object can be written into a group of bytecode. When reading these bytecode from other locations, a new object can be created accordingly, the new object is in the same state as the original object. To achieve Object serialization, you must be able to store and restore private variables of the objects class to ensure that the object state can be properly saved and restored. Correspondingly, the object serialization API can restore these values to private data members during object reconstruction. This is a challenge to Java access permissions. It is usually used for Object Exchange on the server client, and stored on the local machine.
The most important use of Object serialization is to ensure the integrity and portability of objects when passing and saving objects. For example, when transmitting data over the network or saving an object as a file, you must implement a serialization interface.
*
......
[Read the full text]