/** * Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a> * of the specified byte array. */ public static String hexDump(byte[] array) { return hexDump(array, 0, array.length); }
/** * Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a> * of the specified byte array's sub-region. */ public static String hexDump(byte[] array, int fromIndex, int length) { return HexUtil.hexDump(array, fromIndex, length); }
@Override public String asShortText() { String shortValue = this.shortValue; if (shortValue == null) { this.shortValue = shortValue = ByteBufUtil.hexDump(data, data.length - RANDOM_LEN, RANDOM_LEN); } return shortValue; }
/** * Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a> * of the specified buffer's sub-region. */ public static String hexDump(ByteBuf buffer, int fromIndex, int length) { return HexUtil.hexDump(buffer, fromIndex, length); }
/** * Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a> * of the specified byte array's sub-region. */ public static String hexDump(byte[] array, int fromIndex, int length) { return HexUtil.hexDump(array, fromIndex, length); }
@Override public String asShortText() { String shortValue = this.shortValue; if (shortValue == null) { this.shortValue = shortValue = ByteBufUtil.hexDump(data, data.length - RANDOM_LEN, RANDOM_LEN); } return shortValue; }
/** * Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a> * of the specified byte array. */ public static String hexDump(byte[] array) { return hexDump(array, 0, array.length); }
/** * Return a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a> of the line separator in UTF-8 encoding. */ @Override public String toString() { return ByteBufUtil.hexDump(value.getBytes(CharsetUtil.UTF_8)); } }
private int appendHexDumpField(StringBuilder buf, int i, int length) { buf.append(ByteBufUtil.hexDump(data, i, length)); buf.append('-'); i += length; return i; }
/** * Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a> * of the specified buffer's readable bytes. */ public static String hexDump(ByteBuf buffer) { return hexDump(buffer, buffer.readerIndex(), buffer.readableBytes()); }
/** * Return a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a> of the line separator in UTF-8 encoding. */ @Override public String toString() { return ByteBufUtil.hexDump(value.getBytes(CharsetUtil.UTF_8)); } }
private static String bytesToHex(ByteBuf bytes) { try { return ByteBufUtil.hexDump(bytes); } finally { bytes.release(); } }
/** * Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a> * of the specified buffer's readable bytes. */ public static String hexDump(ByteBuf buffer) { return hexDump(buffer, buffer.readerIndex(), buffer.readableBytes()); }
private String generateId() { byte[] id = new byte[8]; // TODO JDK UPGRADE replace to native ThreadLocalRandom PlatformDependent.threadLocalRandom().nextBytes(id); return ByteBufUtil.hexDump(id); }
private String generateId() { byte[] id = new byte[8]; // TODO JDK UPGRADE replace to native ThreadLocalRandom PlatformDependent.threadLocalRandom().nextBytes(id); return ByteBufUtil.hexDump(id); }
protected static String generateId() { byte[] id = new byte[16]; // TODO JDK UPGRADE replace to native ThreadLocalRandom PlatformDependent.threadLocalRandom().nextBytes(id); return ByteBufUtil.hexDump(id); }
protected String generateRequestId() { byte[] id = new byte[16]; // TODO JDK UPGRADE replace to native ThreadLocalRandom PlatformDependent.threadLocalRandom().nextBytes(id); return ByteBufUtil.hexDump(id); }
protected String generateRequestId() { byte[] id = new byte[16]; // TODO JDK UPGRADE replace to native ThreadLocalRandom PlatformDependent.threadLocalRandom().nextBytes(id); return ByteBufUtil.hexDump(id); }
protected static String generateId() { byte[] id = new byte[16]; // TODO JDK UPGRADE replace to native ThreadLocalRandom PlatformDependent.threadLocalRandom().nextBytes(id); return ByteBufUtil.hexDump(id); }
protected String generateId() { byte[] id = new byte[16]; // TODO JDK UPGRADE replace to native ThreadLocalRandom PlatformDependent.threadLocalRandom().nextBytes(id); return ByteBufUtil.hexDump(id); }