Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Vector in ObjectOutputStram

843790May 23 2006 — edited May 23 2006
Hi,


I'm trying to send a Vector trough an ObjectOutputStream, this works but my last added element is never recieved @client side but when I send it with Vector.toString() he recieves all the elements


This is the piece of code where I recieve my Vector as you can see I read the vector and after that I read in the vector as a string



if(message.equals(Constanten.REPLY_REQUEST_USER))
{
output.writeObject(controller.getEmailAdres());
output.flush();


ContactPersonen = (Vector)input.readObject();


String test = (String)input.readObject();


ContactPersonenStaanKlaar = true;


}}




Here is were I send my Vector (first as a vector afterwards as a String)


if(message.equals(Constanten.REQUEST_USERS))
{

output.writeObject(Constanten.REPLY_REQUEST_USER);


//Get Email Adres
message = (String)input.readObject();


//Write Vector (Contactlist)


Vector users = server.getUsersContactList(message);


System.out.println("-------------------------");
for(int x=0; x< users.size(); x++)
{
System.out.println(users.elementAt(x));
}
System.out.println("--------------------------");


output.writeObject(users);


System.out.println(users.toString());
output.writeObject(users.toString());
//output.flush();





}


Anyone any idea ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2006
Added on May 23 2006
5 comments
96 views