List of utility methods to do Hex Calculate
String | toHexString(byte[] bytes, int offset, int len, int max) Creates a String containing the hexadecimal representation of the given bytes. if (bytes == null) return "[null]"; int count = max > -1 && max < len ? max : len; StringBuffer s = new StringBuffer(); for (int i = 0; i < count; i++) { String b = Integer.toHexString(bytes[offset + i] & 0xFF).toUpperCase(); if (b.length() == 1) s.append('0'); ... |
String | toHexString(byte[] bytes, String separator, boolean upperCase) to Hex String StringBuilder hexString = new StringBuilder(); for (byte b : bytes) { String str = Integer.toHexString(0xFF & b); if (upperCase) { str = str.toUpperCase(); if (str.length() == 1) { hexString.append("0"); ... |
String | toHexString(byte[] coded) to Hex String if (coded == null) { return ""; return toHexString(coded, 0, coded.length); |
String | toHexString(byte[] color) to Hex String char[] hexChars = new char[color.length * 2]; int x; for (int i = 0; i < color.length; i++) { x = color[i] & 0xFF; hexChars[i * 2] = HEX[x >>> 4]; hexChars[i * 2 + 1] = HEX[x & 0x0F]; return new String(hexChars); ... |
String | toHexString(byte[] content, int len) to Hex String if (content == null || content.length == 0) { return ""; if (len > content.length) { len = content.length; StringBuilder sb = new StringBuilder(); for (int i = 0; i < len; i++) { ... |
String | toHexString(byte[] data) to Hex String return toHexString(toIntArray(data));
|
String | toHexString(byte[] data) to Hex String return toHexString(data, 0, data.length);
|
String | toHexString(byte[] data) Returns the specified data as hex sequence final int n = data.length; final StringBuilder hex = new StringBuilder(); for (int i = 0; i < n; i++) { final byte b = data[i]; hex.append(String.format("%02x", b & 0xff)); return hex.toString(); |
String | toHexString(byte[] data) to Hex String return toHexString(data, " "); |
String | toHexString(byte[] data) Turn a bytearray into a printable form, representing each byte in hex. StringBuffer sb = new StringBuffer(data.length * 2); for (int i = 0; i < data.length; ++i) { sb.append(Integer.toHexString((data[i] >> 4) & 15)); sb.append(Integer.toHexString(data[i] & 15)); return sb.toString(); |