public static byte[] toBytes(final boolean b) {
    return new byte[] { b ? (byte) -1 : (byte) 0 };
  }
Convert a boolean to a byte array. True becomes -1 and false becomes 0.
@param b value
@return <code>b</code> encoded in a byte array.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java