List of utility methods to do XML Hex
byte[] | fromHex(String hex) from Hex return DatatypeConverter.parseHexBinary(hex);
|
byte[] | fromHex(String str) from Hex return DatatypeConverter.parseHexBinary(new String(reverseHEX(str.getBytes()))); |
byte[] | getBytes(String hex) get Bytes return DatatypeConverter.parseHexBinary(hex);
|
String | getFreshExecutionId() get Fresh Execution Id try { String id = DatatypeConverter.printBase64Binary(MessageDigest.getInstance("SHA-256") .digest(Long.toString(System.currentTimeMillis()).getBytes())); id = id.replace("/", ""); id = id.replace("\\", ""); return id; } catch (NoSuchAlgorithmException nsae) { return "No_ID"; ... |
String | hex(final byte[] bytes) hex return DatatypeConverter.printHexBinary(bytes);
|
byte[] | hex2bin(String input) hexbin input = input.replace(" ", ""); return DatatypeConverter.parseHexBinary(input); |
String | hexFromBinary(byte[] value) Convert (encode) the given binary value to a hex string. return DatatypeConverter.printHexBinary(value);
|
byte[] | hexIn(String s) Helper method to convert strings like: "F0A43205", to actual byte array for easier testing. return DatatypeConverter.parseHexBinary(s);
|
String | hexOut(byte[] byteArray) Make the byte array appear as hex number, without spaces. if (byteArray == null) { return null; } else { return DatatypeConverter.printHexBinary(byteArray); |
String | hexOutSpaces(byte[] byteArray) Make the byte array appear as space separated 2 digit hex numbers. return toHexString(byteArray, true);
|