Here you can find the source of byteToBits(byte b)
public static boolean[] byteToBits(byte b)
//package com.java2s; // it under the terms of the GNU Lesser General Public License as published by public class Main { public static boolean[] byteToBits(byte b) { boolean[] bits = new boolean[8]; for (int i = 0; i < 8; i++) { bits[7 - i] = ((b & (1 << i)) != 0); }/*from w w w .j ava 2 s . c o m*/ return bits; } }