title: Best way to check if a byte[] is contained in another byte[]
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>Hello,</p>
  
  <p>Whats the best way to search if a byte[] is in another byte[].</p>
  
  <p>For example</p>
  
  <pre><code>byte[] first = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 };
  byte[] second = new byte[] { 0x01, 0x02 };
  byte[] third = new byte[] { 0x01, 0x03 };
  </code></pre>
  
  <p>The method would return:</p>
  
  <pre><code>first.Contains(second); // true
  first.Contains(third); // false
  second.Contains(third); // false
  </code></pre>
  
  <p>Thanks!</p>