Here you can find the source of boolToInt(Boolean[] bools_in)
public static int boolToInt(Boolean[] bools_in)
//package com.java2s; //License from project: Open Source License public class Main { public static int boolToInt(Boolean[] bools_in) { // Returns a boolean array representing the integer // Works on a 24 bit unsigned integer int int_out; int_out = 0; for (int ii = 0; ii < bools_in.length; ii++) { if (bools_in[ii]) { int_out += Math.pow(2, ii); }//from w w w. j a v a 2 s . c o m } return int_out; } }