I changed Peek
to reflect the following code. I'm not sure if this is 100% because I typed this from memory directly here.
public char Peek()
{
if (this.CharacterBuffer.Count > 0)
return this.CharacterBuffer.Peek();
char Character
try
{
Character = Convert.ToChar(this.Reader.Read());
}
catch (OverflowException)
{
throw new EndOfStreamException();
}
this.CharacterBuffer.Enqueue(Character);
return Character;
}