• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Proper retrieval of objects from an ObjectStream into a Vector

 
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?
 
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
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic