title: determine if array of bytes contains bytes in a specific order
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/283456/byte-array-pattern-search">byte[] array pattern search</a>  </p>
  </blockquote>
  
  
  
  <p>Let's say I have an array of bytes:</p>
  
  <pre><code>byte[] myArray = new byte[]{1,2,3,4,5,6,7,1,9,3,4,3,4,7,6,5,6,7,8};
  </code></pre>
  
  <p>how can I determine if myArray contains bytes 9,3,4,3 in that order? do I have to iterate through the array appending each element to a string then use the String.Contains() method to know if that byte array contains those elements in that order?</p>
  
  <p>I know I can do semething like:</p>
  
  <pre><code>String s = "";
  foreach(byte b in myArray)
  {
    s = s + b.ToString();
  }
  
  //then do  
  
  s.Contains("9343")
  </code></pre>
  
  <p>this is not to efficient on long arrays. What will be a more efficient way of doing this?</p>