Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Android Security Essentials Live Lessons this week in the Android 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: 8843
    
    7

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.
 
Don't get me started about those stupid light bulbs.
 
subject: Writing/Reading multiple objects of same class using Serialization?
 
Similar Threads
serialization + no valid constructor
A question regarding defaultXxxObject()
ObjectOutputStream -- Error.
Serializable Interface
flushing in java