Java tutorial
//package com.java2s; public class Main { private static byte bits2byteReverse(String bString) { byte result = 0; for (int i = 0, j = 0; i < 8; i++, j++) { result += (Byte.parseByte(bString.charAt(i) + "") * Math.pow(2, j)); } return result; } }