Most of BinaryReader
's read methods throw an EndOfStreamException
if it reaches the end of a stream, but strangely the ReadBytes
method doesn't. But what if I do still want to throw an EndOfStreamException
? How do I detect that?
I could use the BaseStream.Position
property, but the steam I'm using does not support seeking, so this would throw a NotSupportedException
.