title: How to detect if a byte is a line break when reading from a CSV file byte by byte - C#
body: <p>I need to read from a CSV file byte by byte (Note: I don't want to read line by line).
  How can I detect if the byte that was read is a line break ?
  How to know that end of line was reached ?</p>
  
  <pre><code>int count = 0;
  byte[] buffer = new byte[MAX_BUFFER];
  
  using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
  {              
      // Read bytes form file until the next line break -or- eof 
      // so we don't break a csv row in the middle
  
      // What should be instead of the 'xxx' ?
  
      while (((readByte = fs.ReadByte()) != 'xxx') &amp;&amp; (readByte != -1))
      {
          buffer[count] = Convert.ToByte(readByte);
          count++;
      }
  } 
  </code></pre>