Reverse and rotate a long value

static long reverse(long i)
Reversing the order of the bits.
static long reverseBytes(long i)
Reversing the order of the bytes.
static long rotateLeft(long i, int distance)
Rotating the binary long value left by distance.
static long rotateRight(long i, int distance)
Rotating the binary long value right by distance.

public class Main {
  public static void main(String[] args) {
    System.out.println(Long.reverse(123123));
  }
}

The output:


-3528711045533138944
Home 
  Java Book 
    Essential Classes  

Long:
  1. Long class
  2. Constants value from Long class
  3. Constructors from Long
  4. Convert long value to byte, double, float, int, long, short
  5. Decode a string to create long value
  6. Get the long value from a system property
  7. Compare two long values
  8. Parse long value from string
  9. Convert long value to binary, hex and octal format strings
  10. Convert long value to string
  11. Get the sign of the long value
  12. Get the number of zero bits preceding and following
  13. Reverse and rotate a long value