Here you can find the source of unpackDie(byte[] bytes)
public static boolean[] unpackDie(byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean[] unpackDie(byte[] bytes) { boolean[] bits = new boolean[bytes.length * 8]; int mask = 1; for (int i = 0; i < bits.length; i++) { int dataIndex = i / 8; byte dataByte = bytes[dataIndex]; int bitIndex = i % 8; bits[i] = (dataByte & ((byte) (mask << bitIndex))) != 0; }/*from w w w . jav a 2 s . c o m*/ return bits; } }