I think this should do it.
I don't see any place where it could fail.
Apparently I need to and it with 0xFF. Probably because of unsigned and signed data issues. But I would think and 0xFF with anything would just produce that anything (i.e md[i] & 0xFF = md[i] )
I don't know weather it is when you cast it to an integer maybe something is different. Or maybe it should be (int)md[i] & 0xFF instead but does the same thing as I can see.
-26 = E6 , or FFE6 or FFFFFFE6 etc etc depending on if we are talking about
a byte or
word or dword or , etc etc...
so E6 & FF = E6 but FFE6 & FF = E6 Ahh so this is probably it?
An int in java is 32 bits so we are just talking the first byte of it.
I just need clarity am I correct on the reason why I need & 0xFF. Just because byte is the only signed number.
[ December 04, 2008: Message edited by: Martijn Verburg ]