title: DatagramPacket not transmitting the right message
body: <p>I'm implementing a client/server application using UDP transmissions. Here is my part of my code :</p>
  
  <p>Client : </p>
  
  <pre><code>InetAddress serverAddress = ...
  int serverPort = ...
  DatagramSocket socket = new DatagramSocket(9999);
  
  ...
  
  String message = "&lt;HELLO&gt;";
  
  byte[] outbuffer = new byte[1000];
  outbuffer = message.getBytes();
  DatagramPacket packet = new DatagramPacket(outbuffer, outbuffer.length, serverAddress, serverPort);
  socket.send(this.packet);
  </code></pre>
  
  <p>Server :</p>
  
  <pre><code>DatagramSocket serverSocket =  new DatagramSocket(9876);
  
  ...
  
  byte[] inbuffer = new byte[1000];
  DatagramPacket packet = new DatagramPacket(inbuffer, inbuffer.length);
  serverSocket.receive(packet);
  String response = new String(packet.getData(), 0, packet.getLength());
  
  System.out.println(response);
  
  if("&lt;HELLO&gt;".equals(response)){
      System.out.println("OK");
  } else {
      System.out.println("ERROR");
  }
  </code></pre>
  
  <p>My problem is the following: if I print the response String on the client side that is comming from the client, everything looks fine (""). 
  But for some reasons when I trie to compare the response coming from the server using .equals or a RegExp it fails ! </p>
  
  <p>May be it's related to String encoding but I don't know where and why it fails. Both client and server are running on the same host right now, so it might not be related to JVM differences.</p>