/** * Converts a long integer to a full 16-character hex code. */ public static void convertToHex(long value, Appendable out) throws IOException { convertToHex((int)(value >>> 32), out); convertToHex((int)value, out); }
public static String encodeHexData(String data) { // Note: This is always UTF-8 encoded and does not depend on response encoding return StringUtility.convertToHex(data.getBytes(Charsets.UTF_8)); }
/** * Converts an int to a full 8-character hex code. */ public static String convertToHex(int value) { StringBuilder SB = new StringBuilder(8); try { convertToHex(value, SB); } catch(IOException e) { throw new AssertionError(e); } return SB.toString(); }
public static String convertToHex(byte[] bytes) { if(bytes == null) return null; int len = bytes.length; StringBuilder SB = new StringBuilder(len * 2); try { convertToHex(bytes, SB); } catch(IOException e) { throw new AssertionError(e); } return SB.toString(); }
/** * Converts a long integer to a full 16-character hex code. */ public static String convertToHex(long value) { StringBuilder SB = new StringBuilder(16); try { convertToHex(value, SB); } catch(IOException e) { throw new AssertionError(e); } return SB.toString(); }