public static boolean convertByteArrayToBoolean(byte[] booleanAsByteArray) {
    if (booleanAsByteArray == null) {
      throw new IllegalArgumentException("convertByteArrayToBoolean called with a null array");
    }

    if (
      booleanAsByteArray.length == 4
        && (booleanAsByteArray[0] == 't' || booleanAsByteArray[0] == 'T')
        && (booleanAsByteArray[1] == 'r' || booleanAsByteArray[1] == 'R')
        && (booleanAsByteArray[2] == 'u' || booleanAsByteArray[2] == 'U')
        && (booleanAsByteArray[3] == 'e' || booleanAsByteArray[3] == 'E')
    ) {
      return true;
    } else if (
      booleanAsByteArray.length == 5
        && (booleanAsByteArray[0] == 'f' || booleanAsByteArray[0] == 'F')
        && (booleanAsByteArray[1] == 'a' || booleanAsByteArray[1] == 'A')
        && (booleanAsByteArray[2] == 'l' || booleanAsByteArray[2] == 'L')
        && (booleanAsByteArray[3] == 's' || booleanAsByteArray[3] == 'S')
        && (booleanAsByteArray[4] == 'e' || booleanAsByteArray[4] == 'E')
    ) {
      return false;
    } else {
      throw new IllegalArgumentException("Incorrect Boolean Expression");
    }
  }
Converts a boolean expressed in a byte array to an actual boolean
<p>
This doesn't used Bytes.toBoolean because Bytes.toBoolean(byte []) assumes that 1 stands for
true and 0 for false. Here, the byte array representing "true" and "false" is parsed
<p>
@param booleanAsByteArray the boolean value expressed as a byte array
@return the boolean value
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java