/**
* Convert a bytes array to booleans array.
*
* @param bytes
* The array to convert.
* @return A booleans array from bytes array.
*/
private boolean[] bytes2booleans(byte[] bytes) {
boolean[] booleans = new boolean[bytes.length * 8];
for (int iByte = 0; iByte < bytes.length; iByte++) {
for (int iBool = 1; iBool < 8; iBool++)
booleans[iByte * 8 + iBool] = (bytes[iByte] & (byte) Math.pow(
2, 8 - iBool - 1)) > 0 ? true : false;
if (bytes[iByte] < 0)
booleans[iByte * 8] = true;
else
booleans[iByte * 8] = false;
}
return booleans;
}