L
Louis Cyphre
Hi,
I encountered a problem using the ObjectInputStream and
ObjectOutputStream. I wrore:
ObjectInputStream input;
ObjectOutputStream output;
/* here the execution stops */
input = new ObjectInputStream( socket.getInputStream() );
output = new ObjectOutputStream( socket.getOutputStream() );
....where i wrote the comment the execution stops without exceptions (the
application goes on running).
At the contrary, if I write:
DataInputStream input;
DataOutputStream output;
input = new DataInputStream( socket.getInputStream() );
output = new DataOutputStream( socket.getOutputStream() );
....everything works and I can write and read through the socket.
But my intention is to write and read OBJECTS through the socket.
Is there something wrong in my code? How can I exchange objects through
a socket?
Thanks in advance.
I encountered a problem using the ObjectInputStream and
ObjectOutputStream. I wrore:
ObjectInputStream input;
ObjectOutputStream output;
/* here the execution stops */
input = new ObjectInputStream( socket.getInputStream() );
output = new ObjectOutputStream( socket.getOutputStream() );
....where i wrote the comment the execution stops without exceptions (the
application goes on running).
At the contrary, if I write:
DataInputStream input;
DataOutputStream output;
input = new DataInputStream( socket.getInputStream() );
output = new DataOutputStream( socket.getOutputStream() );
....everything works and I can write and read through the socket.
But my intention is to write and read OBJECTS through the socket.
Is there something wrong in my code? How can I exchange objects through
a socket?
Thanks in advance.