title: android, netcat: how to send more than 2048 Byte over UDP
body: <p>I'm trying to implement data transfer from a Notebook (Linux) to an Android Device over UDP.</p>
  
  <p>On the notebook I launch:</p>
  
  <pre><code>cat /home/me/my/file.txt | nc -u 192.168.150.3 12345
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>nc -u 192.168.150.3 12345 &lt; /home/me/my/file.txt
  </code></pre>
  
  <p>getting same result.</p>
  
  <p>On the Android Device my code is:</p>
  
  <pre><code>byte[] msg = new byte[100000];
  
  DatagramPacket p = new DatagramPacket(msg, msg.length);
  DatagramSocket s = new DatagramSocket(portNumber);
  s.receive(p);
  
  message = new String(msg, 0, p.getLength());
  
  s.close();
  </code></pre>
  
  <p>If I set a breakpoint on the line with "message =" I can see msg.length = 100000. That's right. But p.getLength() is only 2048. That means only a part of my data is transferred. I mean "message" doesn't contain all data which is in "file.txt". Why does it happen? What do I do wrong?</p>