title: Additional bytes received by a DatagramPacket
body: <p>I have a problem that I see for the first time ever, I'm using java DatagramSocket (s) for sending and receiving data in my app.</p>
  
  <p>this is how I send the data:</p>
  
  <pre><code>byte[] buffer = "my data".getBytes();
  senderPacket = new DatagramPacket(buffer, 0, buffer.length, remoteAddress, remotePort);
  socket.send(senderPacket);
  </code></pre>
  
  <p>now when I sent the byt[] buffer, it's size was 275.
  but when I received the packet on the receiving app and got the byte[] from the receiverPacket, like this:</p>
  
  <pre><code>buffer = new byte[2048];
  receiverPacket = new DatagramPacket(buffer, buffer.length);
  socket.receive(receiverPacket);
  </code></pre>
  
  <p>I found that the received bytes count where 278 bytes that's additional 3 bytes.</p>
  
  <p>This might seem like not a big problem, but actually it is for me, please any idea why is this happening, and how to solve it, any logical explanation would be helpful.</p>
  
  <p>thanks</p>