My Socket client is written in C and sends the values in the format below:
x00\x2C\x02\x00\xE0\x00
Now I would like to read the hex values from the TCP/IP socket server which is written in Java.
What should be a approach to read the stream values in Java Socket?
I'm trying to read in the following way, but it does not work:
InputStream ins = sock.getInputStream();
int byteRead;
while((byteRead = ins.read()) != -1) {
System.out.println(Integer.toHexString(byteRead & 0xFF));
}