List of utility methods to do Long Bit Shift
boolean | isPowerOfTwo(long n) Returns true if the argument is a power of two. return (n > 0) && ((n & (n - 1)) == 0);
|
long | flip32(long num) for switching big/small endian long tmp = num; tmp = ((tmp & 0x000000FF) << 24) + ((tmp & 0x0000FF00) << 8) + ((tmp & 0x00FF0000) >> 8) + ((tmp & 0xFF000000) >> 24); return tmp; |
long | swap(long x) swap return (long) (((long) swap((int) (x)) << 32) | ((long) swap((int) (x >> 32)) & 0xffffffffL)); |
boolean | isPowerOfTwo(long v) returns true if v is a power of two or zero return ((v & (v - 1)) == 0);
|