public byte ReadByte() { var b = stream.ReadByte(); if (b == -1) { throw new EndOfStreamException(); } return((byte)b); }