public virtual byte read()
{
if (pos < len)
{
// common, fast case
return buf[pos++];
}
// general case
while (!complete && pos >= len)
{
readInput();
}
if (pos == len)
{
throw new System.IO.EndOfStreamException();
}
else if (pos > len)
{
throw new System.IO.IOException("Position beyond EOF");
}
return buf[pos++];
}