title: c# - end of stream reader showing value 65536 ('.')
body: <p>I have created a StreamReader that uses a FileStream.  At the end of the StreamReader method, when using the Peek() method, I see the numeric value 65535.  When converted to a char represents a period '.'  Using a 'watch' in VS, I can see that the EndOfStream has been reached.  What does the 65535 ('.') value mean?  Is the period ('.') its ASCII counterpart?</p>
  
  <p>I had thought I heard that a '0' represents the end of a file/stream.  </p>
  
  <p>Note:  I'm not sure if there's a difference between the EOF and EOS (End of stream) if the stream is consuming a file. </p>
  
  <pre><code>//Contains some business logic, main focus is on the while loop expression
      try
              {
                  //The peek method is used to avoid moving the Stream's position.  
                  //If we don't encounter a number character representing the RDW, keep reading until we find one.
                  while (!Char.IsDigit((char)this.StreamReader.Peek()))
                  {
                      if (!this.StreamReader.EndOfStream)
                          this.StreamReader.Read();
                      else
                          return false;
                  }
                  //Loop completed and found the next record without encountering the end of the stream
                  return true;
              }
              catch (IOException IOex)
              {
                  throw new Exception(String.Format("An IO Exception occured when attempting to set the start position of the record.\n\n{0}", IOex.ToString()));
              }
  </code></pre>