File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes URGENT! How to write an Object to a Socket Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "URGENT! How to write an Object to a Socket" Watch "URGENT! How to write an Object to a Socket" New topic
Author

URGENT! How to write an Object to a Socket

Joe Wiesenfeld
Greenhorn

Joined: Jun 25, 2001
Posts: 6
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

Joined: Feb 22, 2001
Posts: 1072
DataOutputStream out = new DataOutputStream(socket.getOutputStream());
ObjectOutputStream objOut = new ObjectOutputStream(out);
objOut.writeObject(p);// p is a Serializable object
 
IntelliJ Java IDE
 
subject: URGENT! How to write an Object to a Socket
 
Threads others viewed
problem with capturedevice in rtp session
Problem accessing class variable
2 approaches, which to choose?
writing vector object to I/O
can't get to distribute my individual datas into row in JTable
IntelliJ Java IDE