I'm creating an server for an existing client. This client reads input from server using a socket and DataInputStream. It checks for end of server message using:
byte c = in.readByte();
if( c == 0) { //the end.
On the server i'm using a serversocket and DataOutputStream to send message to client:
out.write(bytes[])
How can i send a 0 byte so that the client knows it is the end of the message?