/** * This will convert the supplied value to a hex encoded string. Returns null if the supplied byte array is null. * * @param value to hex encode * * @return hex encoded value */ public static char[] hexEncode(final byte[] value) { return value != null ? Hex.encode(value) : null; }
/** * This will convert the supplied value to a hex encoded string. Returns null if the supplied byte array is null. * * @param value to hex encode * * @return hex encoded value */ public static char[] hexEncode(final byte[] value) { return value != null ? Hex.encode(value) : null; }
/** * This will convert the supplied value to a hex encoded string. Returns null if the supplied byte array is null. * * @param value to hex encode * * @return hex encoded value */ public static char[] hexEncode(final byte[] value) { return value != null ? Hex.encode(value) : null; }
/** * @param raw data to encode * @param encoded valid encoding * * @throws Exception On test failure. */ @Test(groups = {"io"}, dataProvider = "encode-decode") public void encodeAndDecode(final byte[] raw, final String encoded) throws Exception { final char[] c = Hex.encode(raw); Assert.assertEquals(encoded.toCharArray(), c); Assert.assertEquals(raw, Hex.decode(c)); }