Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the Stream.Position a long

I'm was messing around with some parsing of a binary file when I came across something I was wondering about.

The Stream.Positionproperty is of the type Int64or long. Why is this? Shouldn't it make more sense to use a UInt64 since the position in a stream can't be negative?

Anyone know what's the use of this being a signed long instead of an unsigned one?

like image 470
Timo Willemsen Avatar asked Nov 16 '10 21:11

Timo Willemsen


1 Answers

UInt64 is not CLS Compatible, and all classes in the BCL need to be (at least on their public/protected stuff)

The real question is of couse why UInt64 isn't CLS Compatible, and that was already asked and answered :)

like image 123
Michael Stum Avatar answered Oct 19 '22 06:10

Michael Stum