List of utility methods to do Integer to Hex
String | asHex(final int value) as Hex return "0x" + Integer.toHexString(value); |
String | asHex(int i) as Hex return asHex(i, true, false, true);
|
String | asHex(int i, int width) as Hex String s = Integer.toHexString(i); if (s.length() >= width) { return s; StringBuilder sb = new StringBuilder(); for (int chars = width - s.length(); chars > 0; chars--) { sb.append('0'); sb.append(s); return sb.toString(); |
String | asHex(int val) Returns a hex string representation of the given int value. String h = Integer.toHexString(val); return OX + h; |
String | convertIntArrayToHexString(int[] arr) Formats a byte array in hex, without the "0x" notation. StringBuffer strbuf = new StringBuffer(); for (int i = 0; i < arr.length; i++) { if (arr[i] > 255) { throw new IllegalArgumentException("value in array exceeds one byte: " + arr[i]); strbuf.append(padHex(arr[i])); return strbuf.toString(); ... |
String | convertIntToHex(int i) convert Int To Hex String rtrn = Integer.toHexString(i); return rtrn.length() == 1 ? "0" + rtrn : rtrn; |
int | convertInttoHexa(int n) convert int value to hexa return Integer.valueOf(String.valueOf(n), 16);
|
String | int2CharHex(int integer) int Char Hex int low = integer & 0xF; int high = (integer >> 4) & 0xF; return (Character.toString(hexval[high]) + Character.toString(hexval[low])); |
void | int2hex(final int a, final StringBuffer str) inthex str.append(Integer.toHexString(a)); |
String | int2hex(final int i) Convert an integer into a hex-string. String s = Integer.toHexString(i / HEX) + Integer.toHexString(i % HEX);
return s.toUpperCase();
|