Many people think that the role of Java serialization has the following two aspects:
1) Permanently save the byte sequence of the object to the hard disk (usually stored in a file);
2) A sequence of bytes that transmits an object over the network.
But I have a question: in what circumstances will the first function be used? What happens to the second role?
For:
Put your data into a different time and/or place, and continue to use it.
Another time, like save a disk.
Another place, like a network transmission.
Of course, there are a lot of ways to achieve "change time/Place"
Positive solution ... The real self-serialization is still relatively small, many of the framework has been done. Serialization-like features are implemented in many ways, not necessarily by using serialization:
For:
1) When using Tomcat to develop Java EE related projects, when we close Tomcat, the corresponding session objects are stored on the hard disk, if we want to restart the tomcat in the
When it is possible to read the contents of the corresponding session from Tomcat, then the content stored in the session must implement the related serialization operation.
This article from "Jianbo" blog, reproduced please contact the author!
The role of Java serialization