This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Writing/Reading multiple objects of same class using Serialization? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Writing/Reading multiple objects of same class using Serialization?" Watch "Writing/Reading multiple objects of same class using Serialization?" New topic
Author

Writing/Reading multiple objects of same class using Serialization?

Gagan Grover
Greenhorn

Joined: Mar 02, 2007
Posts: 17
How to write and read multiple objects using serialization? The code that I am using to serialize and deserialize is listed below. During the deserialization process ois.isAvailable!=0 is giving false. Can multiple objects be serialized and deserialized in this way?


Gags
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8713
    
    6

Welcome to the JavaRanch.
We ask that you SearchFirst. Your problem with available is because AvailableDoesntDoWhatYouThinkItDoes. If you want to store multiple instances using serialization, you have a few options. See this post.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Gagan Grover
Greenhorn

Joined: Mar 02, 2007
Posts: 17
Hi Joe,

Thanks for your help. I will take care of it next time before posting something.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Writing/Reading multiple objects of same class using Serialization?
 
Similar Threads
flushing in java
Serializable Interface
ObjectOutputStream -- Error.
serialization + no valid constructor
A question regarding defaultXxxObject()