Here you can find the source of flipBytes(int data)
private static int flipBytes(int data)
//package com.java2s; /****************************************************************************** * Copyright (c) 2004, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/* ww w . j ava 2 s . c om*/ * IBM Corporation - initial API and implementation ****************************************************************************/ public class Main { private static int flipBytes(int data) { int byte1 = data & 0xff; int byte2 = (data & 0xff00) >>> 8; int byte3 = (data & 0xff0000) >>> 16; int byte4 = (data & 0xff000000) >>> 24; data = byte1 << 24; data += byte2 << 16; data += byte3 << 8; data += byte4; return data; } }