Java Integer.reverseBytes(int i)
Syntax
Integer.reverseBytes(int i) has the following syntax.
public static int reverseBytes(int i)
Example
In the following code shows how to use Integer.reverseBytes(int i) method.
public class Main {
public static void main(String args[]) {
int n = 170; // 10101010
/*from www .ja v a 2s.co m*/
System.out.println(Integer.reverseBytes(n));
}
}
The code above generates the following result.