Michael Schierl wrote:
Aeloria Resa schrieb:

Hrm, I was browsing through the Base64 code for Fred, and I found
something kind of odd. It does a bitwise and against an integer, but the
mask is 0xFF. Meaning, it does absolutely nothing. (Unless I'm simply
completely asleep. My weak point is bitwise operations, so..)


bytes are signed in java. So casing 0x80 to int gives 0xFFFFFF80.


<snippet>
       in[x] = 0b11101110

       castedX = (int) in[x]
       // castedX is now == 00000000 00000000 00000000 11101110

11111111 11111111 11111111 11101110


HTH.

mihi

_______________________________________________
devl mailing list
[EMAIL PROTECTED]
http://hawk.freenetproject.org:8080/cgi-bin/mailman/listinfo/devl


It's casting 0xFF, not 0x80, but anyways. Umm, why'd you replace it with 1s? When it get's cast, I was under the impression that, like everything else, it pads it with 0s.


0.o?

I'm still rather confused.

_______________________________________________
devl mailing list
[EMAIL PROTECTED]
http://hawk.freenetproject.org:8080/cgi-bin/mailman/listinfo/devl

Reply via email to