Here you can find the source of flip(int i)
Parameter | Description |
---|---|
i | the integer |
public static int flip(int i)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { /**/*w w w .jav a 2 s . c o m*/ * Flips the byte order of an integer * @param i the integer * @return the flipped integer */ public static int flip(int i) { int result = 0; result |= (i & 0xFF) << 24; result |= (i & 0xFF00) << 8; result |= ((i & 0xFF0000) >> 8) & 0xFF00; result |= ((i & 0xFF000000) >> 24) & 0xFF; return result; } }