Android Utililty Methods Boolean Array to Byte Array Convert

List of utility methods to do Boolean Array to Byte Array Convert

Description

The list of methods to do Boolean Array to Byte Array Convert are organized into topic(s).

Method

byte[]createByteArr(boolean[] booleans)
create Byte Arr
int length = booleans.length;
byte[] bytes = new byte[length / 8 + 1];
for (int i = 0; i < length; i++) {
    if (!booleans[i])
        continue;
    int word = i >>> 3;
    bytes[word] |= 1 << (i & 7);
return bytes;
byte[]createByteArr(boolean[] booleans)
create Byte Arr
int length = booleans.length;
byte[] bytes = new byte[length / 8 + 1];
for (int i = 0; i < length; i++) {
    if (!booleans[i])
        continue;
    int word = i >>> 3;
    bytes[word] |= 1 << (i & 7);
return bytes;