I am trying to get the correct int out of an array of bytes.
The bytes is read from a RFIDTag via POS for .Net.
(Acctually I need 18 bits)
In binary the byte array is as follows:
00001110 11011100 00000000 00011011 10000000
What I need to get out of it is:
00 00000000 11101101
(int = 237)
From the original bytes that would be the following bits in reverse order:
——10 11011100 00000000
I have been looking at bitArray. Array.Reverse. And several ways of shifting bits. But I just can’t wrap my head around this one.
Can anyone point me in the correct direction?
You can get the bits and reverse them like this:
Output: