public static boolean[] toBooleanA(byte[] data) {
	    // Advanced Technique: Extract the boolean array's length
	    // from the first four bytes in the char array, and then
	    // read the boolean array.
	    // ----------
	    if (data == null || data.length < 4) return null;
	    // ----------
	    int len = toInt(new byte[]{data[0], data[1], data[2], data[3]});
	    boolean[] bools = new boolean[len];
	    // ----- pack bools:
	    for (int i = 0, j = 4, k = 7; i < bools.length; i++) {
	        bools[i] = ((data[j] >> k--) & 0x01) == 1;
	        if (k < 0) { j++; k = 7; }
	    }
	    // ----------
	    return bools;
	}