title: C# How to extract bytes from byte array? With known starting byte
body: <p>I need to get specific bytes from a byte array. I know the content of the first byte I want and I need x bytes after that.</p>
  
  <p>For example, I have</p>
  
  <pre><code>byte [] readbuffer { 0, 1, 2, 0x55, 3, 4, 5, 6};
  byte [] results = new byte[30];
  </code></pre>
  
  <p>and I need the 3 bytes that appear after "0x55"</p>
  
  <pre><code>byte results == {ox55aa, 3, 4, 5}
  </code></pre>
  
  <p>I'm using:</p>
  
  <pre><code>Array.copy(readbuffer, "need the index of 0x55" ,results, 0, 3);
  </code></pre>
  
  <p>I need to find the index of 0x55</p>
  
  <p>PS: <code>0x55</code> is in an aleatory position in the array.
  PS2: I forgot to mention before that I'm working in .Net Micro Framework. </p>
  
  <p>(I'm sorry for the non code description, I'm a very newbie to programming... and english)</p>
  
  <p>thank you in advance</p>
  
  <p>[edited]x2</p>