FileOutputStream fos = null;
ObjectOutputStream oos = null;
Vector v = new Vector();
v.addElement(new String("data 1"));
try{
fos = new FileOutputStream("filepath");
oos = new ObjectOutputStream(fos);
oos.writeObject(v);
oos.reset();
}catch (Exception e) {
// TODO: handle exception
}finally{
try{
fos.close();
oos.close();
}catch (Exception e) {
// TODO: handle exception
}
}