@Override
  public int compareTo(byte[] value, int offset, int length) {
    if (length != this.value.length) {
      return 1;
    }
    int b = 0;
    // Iterating backwards is faster because we can quit after one non-zero byte.
    for (int i = length - 1; i >= 0 && b == 0; i--) {
      switch (bitOperator) {
        case AND:
          b = (this.value[i] & value[i + offset]) & 0xff;
          break;
        case OR:
          b = (this.value[i] | value[i + offset]) & 0xff;
          break;
        case XOR:
          b = (this.value[i] ^ value[i + offset]) & 0xff;
          break;
      }
    }
    return b == 0 ? 1 : 0;
  }
Returns true if and only if the fields of the comparator that are serialized are equal to the
corresponding fields in other. Used for testing.
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java