The Artima Developer Community
Sponsored Link

Java Answers Forum
Saving vectors to files

1 reply on 1 page. Most recent reply: Dec 13, 2002 1:48 PM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Martin Brien

Posts: 1
Nickname: churchman
Registered: Dec, 2002

Saving vectors to files Posted: Dec 13, 2002 2:08 AM
Reply to this message Reply
Advertisement
I am trying to pass a vector of objects into a file in order to create a database that can be saved after each visit. However I am having problems getting the Output Stream to read the vector to the file. I have tried sending in the vector whole. Sending in each object individually and passing the objects into an array and then sending this in. The program compiles fine but when I run it and try to save to the file it crashes and gives me a number of error messages. Only one refers to a line in the program. This is where i try to write to the file.
Help!!!!!!!!


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Saving vectors to files Posted: Dec 13, 2002 1:48 PM
Reply to this message Reply
You said Output Stream, so I assume you are referring to OutputStream. I think if you use an ObjectOutputStream and all the objects in your collection are Serializable, you should achieve the effect you desire.

Flat View: This topic has 1 reply on 1 page
Topic: Thats Y I luv to play different things with java Previous Topic   Next Topic Topic: basic search

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use