L
Lee Crabtree
I need to shift all of the values in a byte array by more than 8 bits,
meaning that values should flow from one byte to another. Since I don't
know in advance how many bits will be shifting, I can't do something
easy like putting the bytes into a long or uint and shifting that. Let
me give an example:
If I want to shift this:
10010110 00001101
one byte to the right, I need to get:
01001011 00000110 10000000
Now I know how to figure out how many bytes to add onto the end of the
array, but how do I shift the bits across bytes, as opposed to just
lopping them off?
Lee
meaning that values should flow from one byte to another. Since I don't
know in advance how many bits will be shifting, I can't do something
easy like putting the bytes into a long or uint and shifting that. Let
me give an example:
If I want to shift this:
10010110 00001101
one byte to the right, I need to get:
01001011 00000110 10000000
Now I know how to figure out how many bytes to add onto the end of the
array, but how do I shift the bits across bytes, as opposed to just
lopping them off?
Lee