Here you can find the source of flipByte(byte b)
public static byte flipByte(byte b)
//package com.java2s; //License from project: Open Source License public class Main { public static byte flipByte(byte b) { return (byte) (((b & 0x01) << 7) | ((b & 0x02) << 5) | ((b & 0x04) << 3) | ((b & 0x08) << 1) | ((b & 0x10) >> 1) | ((b & 0x20) >> 3) | ((b & 0x40) >> 5) | ((b & 0x80) >> 7)); }/*from www . j a v a 2 s . c om*/ }