Serialization Section Index | Page 6
If a newer version of a serialized object has to be compatible with an older version, it is important that the newer version abides by the rules for compatible and incompatible changes. A compa...more
When an object is serialized, its fully qualified class name, as well as the 64-bit SUID, is written to the stream. Later, when a class attempts to read the serialized object, it is important that...more
The serialization process uses a unique identification value to keep track of the persisted objects. When a Serializable or Externalizable object is saved, it's fully-qualified class name and the ...more
One thing that slows serialization down considerably is the calculation of the serial version unique identifier, or SUID. This value needs to be calculated when an object is written out, because ...more
Variables declared as static members are not considered part of the state of an object because they are shared by all instances of that class. Classes which need to preserve the value of static m...more
Why am I having an InvalidClassException thrown during the serialization of my object which implements the Externalizable interface?
Unlike objects which implement the Serializable interface, it is mandatory for objects implementing the Externalizable interface to also implement a public no-arg constructor. This constructor is ...more
The methods within the Externalizable interface, readExternal() and writeExternal() have public scope. This implies some client object could potentially bypass the Java sandbox mechanisms and ove...more
Can I persist my objects using serialization instead of using a relational or object database?
How should I declare fields within my serializable class to prevent them from being serialized?
Serializing an object involves encoding its state in a structured way within a byte array. Once an object is serialized, the byte array can be manipulated in various ways; it can be written to a f...more