The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Serialization

Posted by Matt Gerrans on December 09, 2001 at 8:18 PM


> Even that wouldn't work. To read the previous objects in the file with this ObjectOutputStream can't seems like we can run a while loop. Becuase I can't seems to find a proper API method which will tell me whether I am at the end of the file or not. Without knowing whether I am at the end of the file always I'll have to read beyond the file limit and face the exception.
> if you go through the post
> java.io.StreamCorruptedException: Type code out of range, is -84 - Istvan Bagyura December 05, 2001 at 6:33 AM (0)
> You might understand what I am talking about....? Or try to write a while loop to read all the objects froma file and if you are successful please let me know :-)
> Senthoor

Is this a real problem or just a curiosity? I can't think of why you'd want to append to an existing serialized file, since when you are deserializing, you need to know exactly how many and which type of objects are in the stream.





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us