Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File input, not happening  RSS feed

 
DANIEL GRESHAM
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok guys heres the problem, I have a Vector that holds person objects I can get it to out put to a file, but I cant get the program to input these objects back into the array. heres the output code, that actually works

This code works just fine I have no problems here. On the otherhand, Here is where I am haveing major problems. The point of this code is to read the file that had been read into and add that data to any new data that is currently in the vector.


I dont nessesarily need the objects to be put into smaller chunks as in each occourance of a person, but if thats whats going on I dont mind fixing it. For my current purposes though I just need it to be put in place.
additionally the objects in the vector are as such


thanks for any help in advance.
Daniel Gresham
 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you serialize your person objects, you iterate the Vector and write each object one at a time. But look at what you do in your loader method. You only read the first object.

Is there a reason why you serialize each person object and not the Vector itself?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!