List of utility methods to do Hex Calculate
String | toHex(int val) to Hex char[] ch8 = new char[8]; for (int i = 8; --i >= 0; val >>= 4) { ch8[i] = HEX_DIGIT[val & 0xf]; return String.valueOf(ch8); |
String | toHex(int val) Converts one int to a hexadecimal ASCII string. int val1, val2; val1 = (val >> 4) & 0x0F; val2 = (val & 0x0F); return ("" + HEX_DIGIT[val1] + HEX_DIGIT[val2]); |
String | toHEX(int value) to HEX return toHEX(value, 4);
|
char | toHex(int value) Returns the hexidecimal character representation for an integer. return HEX_DIGITS[(value & 0xF)];
|
String | toHex(int value) Formats integer value to hex string. return "0x" + Integer.toHexString(value); |
String | toHex(int value, int bits) Conversion pixel to HEX value String hex = Integer.toHexString(value); int padLen = 4 - hex.length(); if (bits == 0) { padLen = 2 - hex.length(); for (int i = 0; i < padLen; i++) { hex = "0" + hex; hex = "0x" + hex; return hex; |
String | toHex(int value, int length) to Hex return toHex(value, length, false);
|
String | toHex(int value, int length) to Hex char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; StringBuffer buffer = new StringBuffer(length); int shift = length - 1 << 2; for (int i = -1; ++i < length;) { buffer.append(hexDigits[value >> shift & 0xf]); value <<= 4; return buffer.toString(); ... |
String | toHex(int value, int minNumOfDigits) to Hex String hexString = Integer.toHexString(value); while (hexString.length() < minNumOfDigits) hexString = "0" + hexString; return "0x" + hexString.toUpperCase(); |
String | toHex(long i) to Hex return toHex(i, 2, false);
|