title: UDP - Can I send two datagram parts, and make the receiving end combine them into one?
body: <p>This is maybe a stupid question, but since I am relatively new to UDP here it goes... If I am having two separate byte arrays that I need the receiving side to get as one big array, for example:</p>
  
  <pre><code>byte[] Array1 = {1,1,1}
  byte[] Array2 = {2,2,2}
  </code></pre>
  
  <p>Can I avoid having to create a buffer and copy each array into it, and then send that buffer, like this:</p>
  
  <pre><code>byte[] Buffer= new byte[Array1.Length + Array2.Length];
  Buffer.BlockCopy(Array1, 0, Buffer, 0, Array1.Length);
  Buffer.BlockCopy(Array2, 0, Buffer, Array1.Length, Array2.Length);
  
  udpClient.Send(Buffer, Buffer.Length);
  </code></pre>
  
  <p>Because if the two are big, and data rate is high, copying uses up much system resources...
  So can I somehow tell the udpClient that I am starting the UDP fragmentation, and then do like this:</p>
  
  <pre><code>udpClient.ImStartingOneBigDatagram();
  
  udpClient.Send(Array1, Array1.Length);
  udpClient.Send(Array2, Array2.Length);
  
  udpClient.ThatsAllFolks();
  </code></pre>
  
  <p>And be sure that the receiving side would get:</p>
  
  <pre><code>byte[] recv = {1,1,1,2,2,2}
  </code></pre>
  
  <p>I am using C# for this, and I dont need to use <code>UdpClient</code>, I was just making my point.</p>