title: Converting array of bytes to array of shorts without copying data
body: <p>I have an array of bytes that are actually 16-bit samples from a sound card. So 1000 bytes actually represents 500 Short (16-bit values).</p>
  
  <p>Currently I'm converting them like this:</p>
  
  <pre><code>byte [] inputData = new byte[1000];
  short [] convertedData = new short[500];
  Buffer.BlockCopy(inputData, 0, convertedData , 0, 1000);
  </code></pre>
  
  <p>It works fine and it's pretty quick as it's a low-level byte copy.</p>
  
  <p>However is there a way to do it without the copy? i.e. tell C# to treat this area of memory as an array of 500 shorts instead of 1000 bytes? I know that in C/C++ I could just cast the pointer and it would work.</p>
  
  <p>This copy happens in a tight loop, up to 5000 times a second, so if I can remove the copy it would be worthwhile.</p>