• Post Reply Bookmark Topic Watch Topic
  • New Topic

Proper retrieval of objects from an ObjectStream into a Vector

 
Mark denHartog
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some serialized Person-objects in a file("object.basket").
Now I want to retrieve those objects and load them (or references rather) into Vector.
How does one know that all objects are retrieved?
I tried this:

(where personnel is a reference to a Vector-object).
The Person-objects do get stored in the personnel-Vector, but I get an EOFException (expecting code) ??
People can u help me out?
 
missam momin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dude try this way
ObjectInputStream in = new ObjectInputStream(new FileInputStream("*.txt"));
Person p = (Person)in.readObject();personnel.addElement(p);}
should work try to call FileInputStream constructor in ObjectInputStream
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!