internal bool AtEnd()
{
long pos = BaseStream.Position;
long len = BaseStream.Length;
//if (pos >= len-1)
// Console.WriteLine("At end of stream");
return BaseStream.Position == BaseStream.Length-1;
}