title: Issues using StreamReader.EndOfStream?
body: <p>So I'm doing a project where I am reading in a config file. The config file is just a list of string like "D 1 1", "C 2 2", etc. Now I haven't ever done a read/write in C# so I looked it up online expecting to find some sort of rendition of C/C++ .eof(). I couldn't find one.</p>
  
  <p>So what I have is...</p>
  
  <pre><code>TextReader tr = new StreamReader("/mypath");
  </code></pre>
  
  <p>Of all the examples online of how I found to read to the end of a file the two examples that kept occurring were</p>
  
  <pre><code>while ((line = tr.ReadLine() != null)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>while (tr.Peek() &gt;= 0)
  </code></pre>
  
  <p>I noticed that StreamReader has a bool EndOfStream but no one was suggesting it which led me to believe something was wrong with that solution. I ended up trying it like this...</p>
  
  <pre><code>while (!(tr as StreamReader).EndOfStream)
  </code></pre>
  
  <p>and it seems to work just fine.</p>
  
  <p>So I guess my question is would I experience issues with casting a TextReader as a StreamReader and checking EndOfStream?</p>