List of utility methods to do Hex String Create
StringBuilder | appendHex(StringBuilder buf, int value, int width) Converts the passed value into hexadecimal representation, and appends that representation to the buffer, left-zero-padded. appendRepeat(buf, '0', width); int offset = buf.length(); for (int ii = 1; ii <= width; ii++) { int nibble = value & 0xF; buf.setCharAt(offset - ii, NIBBLES[nibble]); value >>>= 4; return buf; ... |
void | appendHex(StringBuilder buff, int i) append Hex if (i >= 0 && i < 10) { buff.append((char) ('0' + i)); } else { buff.append((char) ('a' + (i - 10))); |
void | appendHex(StringBuilder builder, int b) append Hex assertByte(b); builder.append(DIGITS[b >> 4]); builder.append(DIGITS[b & 0xf]); |
void | appendHexByte(byte b, StringBuffer buf) Append a byte in hexadecimal form, as two ASCII bytes, e.g. char c = (char) ((b >> 4) & 0xF); if (c > 9) c = (char) ((c - 10) + 'A'); else c = (char) (c + '0'); buf.append(c); c = (char) (b & 0xF); if (c > 9) ... |
void | appendHexByte(final StringBuilder sb, final byte b) append Hex Byte final int v = Byte.toUnsignedInt(b); sb.append(HEX_CHARS[v >>> 4]); sb.append(HEX_CHARS[v & 15]); |
void | appendHexBytes(StringBuilder builder, byte[] bytes) append Hex Bytes for (byte byteValue : bytes) { int intValue = byteValue & 0xFF; String hexCode = Integer.toString(intValue, 16); builder.append('%').append(hexCode); |
void | appendHexDumpRowPrefix(StringBuilder dump, int row, int rowStartIndex) append Hex Dump Row Prefix dump.append(NEWLINE); dump.append(Long.toHexString(rowStartIndex & 0xFFFFFFFFL | 0x100000000L)); dump.setCharAt(dump.length() - 9, '|'); dump.append('|'); |
void | appendHexEntity(final StringBuilder out, final char value) Append the given char as a hexadecimal HTML entity. out.append("&#x"); out.append(Integer.toHexString(value)); out.append(';'); |
void | appendHexEscape(StringBuilder out, int codePoint) Appends the Unicode hex escape sequence for the given code point (backslash + 'u' + 4 hex digits) to the given StringBuilder. if (Character.isSupplementaryCodePoint(codePoint)) { char[] surrogates = Character.toChars(codePoint); appendHexEscape(out, surrogates[0]); appendHexEscape(out, surrogates[1]); } else { out.append("\\u").append(HEX_DIGITS[(codePoint >>> 12) & 0xF]) .append(HEX_DIGITS[(codePoint >>> 8) & 0xF]).append(HEX_DIGITS[(codePoint >>> 4) & 0xF]) .append(HEX_DIGITS[codePoint & 0xF]); ... |
void | appendHexJavaScriptRepresentation(StringBuilder sb, char c) Returns a javascript representation of the character in a hex escaped format. sb.append("\\u"); String val = Integer.toHexString(c); for (int j = val.length(); j < 4; j++) { sb.append('0'); sb.append(val); |