How to use ObjectOutputStream/ObjectInputStream?
A sample code here, which writes to ObjectOutputStream, and reads it back from ObjectInputStream. The program not only deals with instance object, but also Class object. In addition, it uses reflection to analyze how it works. Find it at TestSerialization.java Pretty heavy i/o, serialization, reflection, transient/static stuff, if it is too over your head, skip it.
Related Questions
- What is the correct order of ObjectInputStream/ObjectOutputStream creation on the client and the server when sending objects over a network connection?
- Why is OutOfMemoryError thrown after writing a large number of objects into an ObjectOutputStream?
- How can I create an ObjectInputStream from an ObjectOutputStream without a file in between?