I have this client code
dOut = new DataOutputStream(socket.getOutputStream());
oos = new ObjectOutputStream(socket.getOutputStream());
dOut.writeByte(2); <--when readByte on server gives -84
oos.writeObject(rectangle);
if slightly changed
dOut = new DataOutputStream(socket.getOutputStream());
dOut.writeByte(2); <--when readByte on server gives 2
oos = new ObjectOutputStream(socket.getOutputStream());
oos.writeObject(rectangle);
why is this happening? case is similar in inputstream as well.