public override int ReadByte() { if (readPos_>=end_) { // -1 is the correct value at end of stream. return -1; } lock (baseStream_) { baseStream_.Seek(readPos_++, SeekOrigin.Begin); return baseStream_.ReadByte(); } }