public static byte booleansToByte(boolean[] array) {
        if (array != null && array.length > 0) {
            byte b = 0;
            for (int i = 0; i <= 7; i++) {
                if (array[i]) {
                    int nn = (1 << (7 - i));
                    b += nn;
                }
            }
            return b;
        }
        return 0;
    }
byte[] to hex string, such as [0,1] --> "0001"

@param bytes data
@return hex string
core/common/src/main/java/com/alipay/sofa/rpc/common/utils/CodecUtils.java