I would like to represent a 10 bit unsigned integer in C#. I need to read and write it into BinaryStream and use ++ unary operator. Should I use int as an internal representation or is there a better way?
I would like to represent a 10 bit unsigned integer in C#. I need
Share
I would use
unsigned shortas my base type. Writing to binary stream is going to be fun no matter what, because you’ll need to pack four of these numbers to get a whole number of bytes into the stream (assuming that you want packing).