• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading multiple object serialization

 
Henrique Boreg
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am using object serialization to write objects to a file. Since I have lots of objects of the same type, I use a for loop:


This works fine, but how can I load all of these objects back again using the same loop approach, i tried the following:



This appears to work when I print out the results and they match the same values that were initially serialized, but I various Exceptions. What is the correct way to loop through all of the serialized objects until an EOF is reached?

Thanks.
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly which of the 'various exceptions' are you getting, and on which line(s)?
 
Henrique Boreg
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its fixed now, the problem was an EOFException not being handled. Thanks anyways.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!