try changing unsigned
to int
and >>
shift operator to java's >>>
unsigned shift operator.
this should be valid if your unsigned
type is 32 bits long.
in java all number primitives are signed, but using the hint, your method should work similar to C
version.