B
Brian Patterson
Egad - it's late and my brain hurts so I hope someone can help me out. I
currently have a byte array. Lets say the first 2 bytes in this array
represent a 16 bit number. I'm currently taking the first byte and bit
shifting it to the left by 8 and then adding this value to the next byte.
This gives me the number I need but I'm not liking the performance of my
loops when the bytes get to be 8 bytes long for example (in which case I bit
shift the first byte to to the left 8 places and I do this 7 times, the next
byte I bit shift 6 times and so on). Can someone enlighten me to an easier
way of doing this. Lets say I have
0x01 and 0x02 in my byte array. this number should be 258 but how can I
easily convert this in code?
Thanks!
Brian
NOTE: Remove upper can from email address to email me directly.
currently have a byte array. Lets say the first 2 bytes in this array
represent a 16 bit number. I'm currently taking the first byte and bit
shifting it to the left by 8 and then adding this value to the next byte.
This gives me the number I need but I'm not liking the performance of my
loops when the bytes get to be 8 bytes long for example (in which case I bit
shift the first byte to to the left 8 places and I do this 7 times, the next
byte I bit shift 6 times and so on). Can someone enlighten me to an easier
way of doing this. Lets say I have
0x01 and 0x02 in my byte array. this number should be 258 but how can I
easily convert this in code?
Thanks!
Brian
NOTE: Remove upper can from email address to email me directly.