Check Java Object Serialization Compatibility
Is object serialization backwards compatible from Java8 to Java7? I.e., does the Java serialization specification () guarantee that the following works: I compile class A into a Java8 application, serialize an object of A (into a file, say) and deserialize that object in a Java7 application (compiled with the same version of class A). Could somebody point me to the exact part of the specification which specifically adresses different major versions? Dorsch Friedrich Diccionario De Psicologia Pdf Printer here.
Elsa is object graph serialization framework for Java. It has good compatibility with Java Serialization, but is faster and more space efficient. Elsa is great for. Piet Obermeyer and Jonathan Hawkins Microsoft Corporation. Updated March 2002. Summary: Why would you want to use serialization? The two most important reasons are to persist the state of an object to a storage medium so an exact copy can be recreated at a later stage, and to send the object by value.
If there is none, from what part can I deduce said compatibility? Thank you in advance! Note: Section 5.1 of the specification is about class version compatibility, but not about Java version compatibility.
Unfortunately I do not have a deep knowledge of C# but based on your words I can conclude that Java serialization is weaker. Field serialVersionUID is optional and can help only if you changed the class binary signature but have not changed the serializable fields. If you changed the fields you cannot read previously serialized object. The only workaround is to implement your own searilzation mechanism.
Java allows this. You have to implement your own readObject() and writeObject() methods. These methods should be smart enough to support backwards compatibility.
Please see javadoc of java.io.Serializable for more details.