Serialization Section Index | Page 5
If you don't have any previously serialized objects of that class around, you can initialize serialVersionUID to any long value you want. However, if you do have older versions of your class and ...more
I keep getting an InvalidClassException when I read in my serialized objects. What am I doing wrong?
An InvalidClassException is thrown if the serial version of the object read from the stream does not match that of the loaded class. What probably happened is you changed your class definition s...more
There are limits, but it's difficult to quantify most of them. For example, the JVM stack size affects the graph serialization, since the tree walking is done depth-first, recursively. (This is c...more
When trying to serialize large strings, or pass large strings as parameters to remote methods, I keep getting a java.io.EOFException. This only happens for trings, not for other large objects. What is the problem?
When trying to serialize large strings, or pass large strings as parameters to remote methods, I keep getting a java.io.EOFException. This only happens for strings, not for other large objects. W...more
Yes. No special steps are needed for this to work.
Using ObjectOutputStream, how can I use writeObject() to write the same object twice, so on the other end readObject() will read two separate objects, not two references to the same object?
Java's serialization mechanism keeps track of which objects were written to an ObjectOutputStream; when an object is written for the second time a object handle is sent in place of the actual obj...more
I want to have complete control of the binary file format generated by ObjectOutputStream, so I implemented Externalizable in my objects and extended ObjectOutputStream so that I could overwrite the writeStreamHeader() and readStreamHeader() methods.
I want to have complete control of the binary file format generated by ObjectOutputStream, so I implemented Externalizable in my objects and extended ObjectOutputStream so that I could overwrite t...more
Instead of specifying the CODE attribute of an <APPLET> tag, you use the OBJECT attribute, as in: <APPLET OBJECT=TheApplet.ser WIDTH=300 HEIGHT=300 > </APPLET> This allow...more
The Java programming language was designed from the ground up to be compatible with multiple character sets from multiple languages. This entails using a non-ASCII character and string representa...more
Can an application running in a version 1.1.x JVM read an object that was serialized by an application running in a version 1.2.x JVM?
Changes were made to the default serialization stream format between version 1.1.x and version 1.2.x of the JDK. As a result, if you are writing objects with one version and reading them with an...more
Tools.h++ Professional by RogueWave http://www.roguewave.com/products/toolspro/
When an object is deserialized, its internal state is restored to what it was at the time of serialization. So if you serialized a good object, you will get a good object back or an exception will...more
Yes. In fact, it is recommended that you buffer all your input and output unless you have a good reason not to. Here's an example of how to do this: ... String myobject = new String("my...more
The serialization format is independent of browser, independent of JVM vendor, and independent of platform. So serialization should work with any combination of the above. For example, a serializ...more
The advantages of serialization are: It is easy to use and can be customized. The serialized stream can be encrypted, authenticated and compressed, supporting the needs of secure Java comput...more