title: What is the fastest way to scan a C# byte[] for two bytes on a 64 bit computer and return the location?
body: <p>I have an in-memory <code>byte[]</code> and need to locate the offset where <code>13</code> and <code>10</code> are.   I will then use the following to extract that line:</p>
  
  <pre><code> String oneLine = Encoding.ASCII.GetString(bytes, 0, max);
  </code></pre>
  
  <p>What is the fastest way to search for the two bytes on a x64 bit computer? ..and convert it to a string?</p>
  
  <p>Is there anything I can do other than iterating through each byte, scanning for <code>13</code> and then scan for <code>10</code>?  </p>
  
  <pre><code>// Disclaimer: 
  // This is just for my curiosity.  Perhaps I'll gain a better understanding of
  // how .NET interfaces with RAM, the CPU instructions related to comparisons, etc.
  //  
  // I don't suspect a performance problem, but I do suspect a lack of understanding
  // (on my part) on how C# does low-level operations.
  </code></pre>