Forgot your
password?
HOME
FAQS
FORUMS
DOWNLOADS
ARTICLES
PEERSCOPE
LEARN
Search
View:
What's New
Index by Topic
Contributors
Topic List
Printable View
Unanswered Questions
Suggested Path
Serialization FAQ Index By Topic
Java:API:Serialization
What is object serialization?
How should I declare fields within my serializable class to prevent them from being serialized?
Can I persist my objects using serialization instead of using a relational or object database?
What are the security ramifications of using the Externalizable interface?
Why am I having an InvalidClassException thrown during the serialization of my object which implements the Externalizable interface?
Why doesn't serialization save the value of static variables?
How can I speed up serialization?
What is the Stream Unique IDentifier (SUID) that is written out as part of the serial stream?
What is the purpose of the tool "serialver"? How is it used?
What are the compatible and incompatible changes when dealing with versioned serialized objects?
What are the advantages and disadvantags of serialization?
Does serialization depend on the browser, platform, or VM?
Can I use a
BufferedOutputStream
with an
ObjectOutputStream
to serialize an object?
How can I validate what I've just deserialized?
What resources are available to read Java serialized output in C++ programs?
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?
What is UTF that Serialization uses to write strings?
How do I load a serialized applet?
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. But still when I write data to the stream, some extra information is written. How can I prevent this?
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?
If an object is serialized by a 1.1.x VM, can it be de-serialized by a 1.2.x VM?
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. What is the problem?
Are there any system properties in Java that affect Serialization?
I keep getting an
InvalidClassException
when I read in my serialized objects. What am I doing wrong?
Is there a maximum size of a serialized object tree graph?
Can I use an arbitrary
long
value for
serialVersionUID
when I declare it in my class?
How do I handle versioning of my
Externalizable
classes? Do I have to write a version number to the stream?
How do I use the
@serial
javadoc tag?
How do I use the
@serialData
javadoc tag?
What things are required for a class that implements
Externalizable
?
What things are required for a class that implements
Serializable
?
I'm having trouble getting
Externalizable
to work. Can you give a simple code example?
How can I save an
Image
object using serialization?
Can I serialize an array directly, or do I have to wrap it in an object first?
My subclass implements
Serializable
but my superclass doesn't. Both subclass and superclass contain instance variables that need to be saved as part of the state of the subclass. Will serialization save the superclass fields for me?
Are there any other FAQs on Serialization?
When using object streams over sockets, I have to flush the streams after each write operation. In fact I even have to flush the output stream soon after creation. Is there a way out of this?
What role does serialization have in RMI?
Can I pass
Externalizable
objects by value using RMI, or do the objects have to implement
Serializable
directly?
How do I use the
@serialField
javadoc tag?
The javadoc documentation for every Swing class contains the warning that "Serialized objects of this class will not be compatible with future Swing releases." What exactly does this mean, and how does it affect how I write my Swing applications?
How can I make a deep copy of an object using serialization?
Why would I want to implement
Externalizable
instead of
Serializable
?
ObjectOutputStream
seems to be holding a reference to all the objects in my large graph, even after I close the stream. This keeps my objects from being garbage collected. Is this a bug?
I keep getting a
StackOverflowError
when I try to serialize my objects. What does this mean and how can I stop it?
How can I programmatically obtain the
serialVersionUID
for a class?
What are the
writeReplace()
and
readResolve()
methods used for?
How has Serialization changed in the Java 2 SE SDK, v1.3?
Is writing an object to an
ObjectOutputStream
a thread-safe operation?
Does serialization support encryption?
Can an object of type
Class
be serialized?
What are the security considerations for serialization?
How can I read and write serialized objects to and from a database?
I am able to write an object using
ObjectOutputStream
but when I try to read the object back using
ObjectInputStream
I get a
StreamCorruptedException
. How can I overcome this?
Can I serialize an object that has native methods?
Is there a way to serialize an object as an XML document?
Can a
Vector
or a
Hashtable
be serialized and deserialized?
How can I change the names of instance variables in a class which is Serializable and still be able to read serialized files from a previous version of the class? If I use
serialver
to create a version ID then implement
readObject()
, how would I know in which order to read in the instance variables from the old serialized files?
What is an object graph?
What is
ObjectStreamClass
used for?
What is
ObjectStreamField
used for?
What is a serialized bean?
How can I serialize an object into a byte array?
How can I modify a serialized object which is stored in a file if the file contains a large number of objects?
How can an applet read a serialized object residing in the same directory?
Why should I implement
readObject()
even if I don't implement
writeObject()
?
Where can I find the official documentation of the Sun Java SDK tools?
Are methods also serialized along with the data members?
Is there any significant performance gain in serialization from declaring instance variables as
transient
?
Is there any way to save the state of an object of a class which does not implement
Serializable
or
Extenalizable
?.
What's the difference between the SUID (Stream Unique IDentifier) and the private static member
serialVersionUID
?
Are classes that implement
Serializable
required to have no-argument constructors?
Are there any limits on the size of a serialized object?
How can I determine the byte length of an object that I serialize to a stream?
What is the role of serialization in EJB?
How can I instantiate a serialized JavaBean into an applet if my .ser file is in jar or zip archive?
What is the correct order of
ObjectInputStream
/
ObjectOutputStream
creation on the client and the server when sending objects over a network connection?
How can I serialize a JavaMail Message?
Where can I learn (more) about Java's I/O (input/output, IO) capabilities?
Where can I learn (more) about Java's support asynchronous and publish/subscribe messaging using JMS (Java Message Service)?
Where can I learn (more) about Java RMI (Remote Method Invocation)?
What does the
Serializable
interface do?
What's the serialver syntax to get the serialVersionUID of an array?
How can i implement Serializable with my own Custom Data Format?
What is the easiest way to convert my java beans into xml?
Related Links
Serialization FAQ
Serialization Forum
Serialization specification
Sun's Java Tutorial
Wish List
Features
About jGuru
Contact Us