Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Vector serialization

Posted on 2001-07-27
4
Medium Priority
?
1,670 Views
Last Modified: 2010-05-18
Is it possible to serialize a vector, and if so how?

thanks in advance...
ck
0
Comment
Question by:captainklink
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Accepted Solution

by:
Recall earned 200 total points
ID: 6326267
Yes it is.  Vector implements the Serializable interface, so you can simply create a FileOutputStream and write your object to it ...

See here for more info

http://developer.java.sun.com/developer/technicalArticles/Programming/serialization/

Recall
0
 
LVL 1

Expert Comment

by:googlyralph
ID: 6326272
yes, its just an object, and as such you can call a write method on it.

//Vector writing class

Vector myVector = new Vector();
try{
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("theVEctorFile"));
out.writeObject(myVector);
out.close();
}catch(Exception e){
System.out......
}

Googly Ralph.
0
 
LVL 92

Expert Comment

by:objects
ID: 6326338
Just make sure all the elements in the Vector are serializable.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 8975297
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


-- points to Recall


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question