Java Byte Flip flipByte(byte b)

Here you can find the source of flipByte(byte b)

Description

flip Byte

License

Open Source License

Declaration

public static byte flipByte(byte b) 

Method Source Code

//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*/
}

Related

  1. flipBytes(byte[] bytes)
  2. flipBytes(int data)