File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 8710
    
    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.
A question regarding defaultXxxObject()
serialization + no valid constructor