Serialization Section Index | Page 6
What are the compatible and incompatible changes when dealing with versioned serialized objects?
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
What is the purpose of the tool "serialver"? How is it used?
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
What is the Stream Unique IDentifier (SUID) that is written out as part of the serial stream?
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
How can I speed up serialization?
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
Why doesn't serialization save the value of static variables?
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
What are the security ramifications of using the Externalizable interface?
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
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
Can I persist my objects using serialization instead of using a relational or object database?
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?
How should I declare fields within my
serializable class to prevent them from
being serialized?
What is object serialization?
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