public bool Match(string s)
{
if (s == null)
{
throw new ArgumentNullException("s");
}
if (s.Length == 0)
{
throw new ArgumentException("Cannot match empty string");
}
for (int i = 0; i < s.Length; i++)
{
if (_buf.Length < i + _readPos + 1)
{
int n = _reader.Read();
if (n != Eof)
{
_buf.Append((char) n);
}
else
{
return false;
}
}
if (_buf[i + _readPos] != s[i])
{
return false;
}
}
return true;
}