public static String byte2hex(byte[] bytes) {
        StringBuilder hs = new StringBuilder();
        String stmp;
        for (int n = 0; bytes != null && n < bytes.length; n++) {
            stmp = Integer.toHexString(bytes[n] & 0XFF);
            if (stmp.length() == 1) {
                hs.append('0');
            }
            hs.append(stmp);
        }
        return hs.toString().toUpperCase();
    }
@Test
    public void byte2hex() {
        String s = "5";
        try {
            CodecUtils.hex2byte(s);
            Assert.fail();
        } catch (Exception e) {
            Assert.assertTrue(e instanceof IllegalArgumentException);
        }
        s = "567400075b6f626a65";
        byte[] bs = CodecUtils.hex2byte(s);
        Assert.assertTrue(s.equalsIgnoreCase(CodecUtils.byte2hex(bs)));
    }