View Single Post
  #3 (permalink)  
Old 01-06-2008, 07:52 PM
jelly's Avatar
jelly jelly is offline
Member
 
Join Date: Jan 2008
Location: Somerset, UK
Posts: 46
jelly is on a distinguished road
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
Reply With Quote