Here you can find the source of shiftBits(byte b)
public static byte shiftBits(byte b)
//package com.java2s; //License from project: Apache License public class Main { public static final int b1 = Integer.parseInt("11110000", 2); public static final int b2 = Integer.parseInt("1111", 2); public static byte shiftBits(byte b) { int upper = b << 4 & b1; int lower = b >> 4 & b2; // if (LangUtil.getBit(7, b)) { // lower = lower | b3; // } return (byte) (upper | lower); }// w w w .j a v a 2 s. c om }