title: Copy bytes from one array to another
body: <p>I'm trying to copy a specific amount of bytes from one byte array, to another byte array, I've searched through numerous answers to similar questions, but can't seem to find a solution.</p>
  
  <p>Basic example of code,</p>
  
  <pre><code>byte[] data = new byte[1024];
  int bytes = stream.Read(data, 0, data.Length);
  
  byte[] store;
  </code></pre>
  
  <p>if I do</p>
  
  <pre><code>Console.WriteLine(bytes);
  </code></pre>
  
  <p>it will return the number of bytes read from stream which is </p>
  
  <pre><code>24
  </code></pre>
  
  <p>which is the only bytes I would need to pass over to the ' store ' array.. but of course if i specify </p>
  
  <pre><code>byte[] store = data;
  </code></pre>
  
  <p>then it will take 1024 bytes, 1000 of which are empty.</p>
  
  <p>so what I want really is something like</p>
  
  <pre><code>byte[] store = (data, 0, bytes);
  </code></pre>
  
  <p>which would provide store 24 bytes from the data array.</p>