title: Converting a two dimensional int array to a byte array
body: <p><br> I want to convert a two dimensional int array to a byte array. what is the most simple way to do so? <br> Example:</p>
  
  <pre><code>int[,] array = new int[2, 2] { { 2, 1 }, { 0, 1 } };
  </code></pre>
  
  <p>How can i convert <code>array</code> to a <code>byte[]</code>? On your answer, please include also the reverse function to that. (if there is a function to convert an <code>int[,]</code> to a <code>byte[]</code> please show me also how to convert a <code>byte[]</code> to an <code>int[,]</code> ) <br>
  If you're asking yourself why do i need to do it: i need to send a <code>int[,]</code> over a TCP client to a server, then send a response to the client 
  <br>
  PS: I thought about making a <code>[Serializeable]</code> class, which will contain the <code>int[,]</code>, then serialize the class into a file and send that file, on the server side i will deserialize that file and get the array from there. but i thought that it would take a lot more resrouces to do that then just converting it to a <code>byte[]</code>. <br>
  Thank you for your help! :)</p>