public static int booleanArray2Integer(boolean[] input, int length) {
		int integer = 0;
		for (int bit = 0;bit < length;++bit)
		    integer = (integer << 1) + (input[bit] ? 1 : 0);
		//System.out.println("booleanArray2Integer: "+integer);
		return integer;
	}