Hi all,
I am a novice when working with binary data and wondered if some of you experts could help.
I have a byte array of which contain integers. The 8th bit of the first byte is a control bit which tells me if the integer continues into the next byte and the 7th bit is a sign bit. Bits 1 through 6 will be an integer. If the control bit is 1 then the integer continues to the next byte and in the next byte bits 1-7 will be added to the integer in the first byte.
Ex.
00000010 10001110
Byte 2 Byte 1
Byte2 = 128 + Byte1 = 142 -- Total = 270
Anyway to cut to the chase I am trying to figure out how to read this information.
Sorry if this sounds cryptic but as I said I am a newbie.
Thanks
I am a novice when working with binary data and wondered if some of you experts could help.
I have a byte array of which contain integers. The 8th bit of the first byte is a control bit which tells me if the integer continues into the next byte and the 7th bit is a sign bit. Bits 1 through 6 will be an integer. If the control bit is 1 then the integer continues to the next byte and in the next byte bits 1-7 will be added to the integer in the first byte.
Ex.
00000010 10001110
Byte 2 Byte 1
Byte2 = 128 + Byte1 = 142 -- Total = 270
Anyway to cut to the chase I am trying to figure out how to read this information.
Sorry if this sounds cryptic but as I said I am a newbie.
Thanks