|
The problem you are seeing comes from the line:
System.out.println("\nString read from Server = "+b.toString());
This line is calling toString() on the byte array - which by default is simply printing the memory address. I suspect what you are trying to do is print the contents of the byte array, you need to create a string from the bytes:
System.out.println("\nString read from Server = "+ new String(b));
Hope that helps
|