How to pass integer values between sockets?
Hi all,
I figured out how to pass strings of text between sockets (like this...)
PrintWriter ClientOut = null; // to send messages to the server
BufferedReader ClientIn = null; // to receive messages from the server.
PrintWriter ServerOut = null; // to send messages to the client
BufferedReader ServerIn = null; // to receive messages from the client.
and then to write a string of text you do this...
ServerOut.write("here is some text");
ServerOut.flush();
and then you read it on the other side like this...
ServerIn.readLine();
My question today is how to write integers and read them. I know I could write them in a text format, but when I read them I want to do something like this...
int temp = 0;
temp = ServerIn.readInteger(); (or whatever)
could someone help me with this?
Thanks

