When learning the Jedis part of Redis, use the serialization tool to Protostuff (Protobuf's Java client). When I first saw the serialization of these words, I felt confused. So, referring to a lot of information on the Internet, understand the Java serialization and deserialization (reference 7992448/), the role of Protobuf and the use of Java in the method.
What is 1.Java serialization and deserialization:
Java Serialization refers to the process of converting a Java object to a sequence of bytes, while Java deserialization refers to the process of reverting a sequence of bytes to a Java object.
2. Why Java serialization and deserialization is required
Two of the most important applications of serialization are:
- Use serialization to save the collection of objects to a disk file and obtain them as they are stored.
- A collection of objects is routed over the network to another computer.
3. Why can I use serialization and deserialization only
- In a disk file, the memory address of the object cannot be saved and restored because it may occupy a completely different memory address than the original when the object is overloaded.
- In network transmissions, the memory addresses that the objects occupy are completely different when communicating between different processors.
4. The benefits of serialization and deserialization
Serialization means that each object is saved with a sequence number , which is what this mechanism is called
(record) Java serialization and deserialization