java.lang.Long.reverseBytes()


java.lang.Long.reverseBytes()

package com.codingdict;



import java.lang.*;



public class LongDemo {



   public static void main(String[] args) {



      long l = 210;

      System.out.println("Number = " + l);



      /* returns the string representation of the unsigned long value 

         represented by the argument in binary (base 2) */

      System.out.println("Binary = " + Long.toBinaryString(l));



      /* returns the value obtained by reversing the bytes in the specified

         long value */ 

      System.out.println("After reversing = " + Long.reverseBytes(l));

   }

}