This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URGENT! How to write an Object to a Socket  RSS feed

 
Joe Wiesenfeld
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to write a Vector to a socket and I'm having problems.
I tried
out= new BufferedOutpurStream(connection.getOutputStream())
then
connection.out.write(Vector)
I'm getting a compile error:
Incompatible type for method. Can't convert java.util.Vector to int.
Please help ASAP.
Thank you
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DataOutputStream out = new DataOutputStream(socket.getOutputStream());
ObjectOutputStream objOut = new ObjectOutputStream(out);
objOut.writeObject(p);// p is a Serializable object
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!