public static boolean[] byte2Booleans(byte b) {
        boolean[] array = new boolean[8];
        for (int i = 7; i >= 0; i--) { //对于byte的每bit进行判定
            array[i] = (b & 1) == 1; //判定byte的最后一位是否为1，若为1，则是true；否则是false
            b = (byte) (b >> 1); //将byte右移一位
        }
        return array;
    }
@Test
    public void byte2Booleans() {
        Assert.assertEquals(0, CodecUtils.booleansToByte(null));
        Assert.assertEquals(0, CodecUtils.booleansToByte(new boolean[0]));

        // 01010101
        boolean[] bs = new boolean[] { false, true, false, true, false, true, false, true };
        byte b = CodecUtils.booleansToByte(bs);
        Assert.assertEquals(85, b);

        boolean[] bs2 = CodecUtils.byte2Booleans(b);
        for (int i = 0; i < bs.length; i++) {
            Assert.assertEquals(bs[i], bs2[i]);
        }
    }