title: How to receive only actual data from a socket
body: <p>i am sending 20 bytes of data from my udpserver to a client in java. At the client side i am receiving like this</p>
  
  <pre><code>byte[] buf = new byte[25];
  final DatagramPacket recv = new DatagramPacket(buf,25);
  String data = new String(recv.getData());
  </code></pre>
  
  <p>when i print data it is printing additional things. How can i only get my actual data. Please suggest.</p>