public static byte[] hexDecode(String s) { try { return Hex.decodeHex(s.toCharArray()); } catch (DecoderException e) { throw new ClientProblemException( "Hex content is not valid hex: " + e.getMessage() + ": " + s); } }
private static String hexEncode(byte[] bytes) { return new String(Hex.encodeHex(bytes)); }