@Test public void testByteToHex() { Assert.assertNull(StringUtils.byteToHex(null)); Assert.assertEquals("", StringUtils.byteToHex(new byte[]{})); Assert.assertEquals("010203", StringUtils.byteToHex(new byte[]{0x1, 0x2, 0x3})); Assert.assertEquals("7F80", StringUtils.byteToHex(new byte[]{Byte.MAX_VALUE, Byte.MIN_VALUE})); Assert.assertEquals("1F2A30", StringUtils.byteToHex(new byte[]{0x1f, 0x2a, 0x30})); }
public static String byteToHex(byte[] data) { if (data == null) { return null; } final StringBuilder builder = new StringBuilder(); for (final byte b : data) { builder.append(String.format("%02X", b)); } return builder.toString(); }
StringUtils { public static String byteToHex(byte[] data) { if (data == null) { return null; } final StringBuilder builder = new StringBuilder(); for (final byte b : data) { builder.append(String.format("%02X", b)); } return builder.toString(); } }
StringUtils { public static String byteToHex(byte[] data) { if (data == null) { return null; } final StringBuilder builder = new StringBuilder(); for (final byte b : data) { builder.append(String.format("%02X", b)); } return builder.toString(); } private  StringUtils(); }
StringUtils { public static String byteToHex(byte[] data) { if (data == null) { return null; } final StringBuilder builder = new StringBuilder(); for (final byte b : data) { builder.append(String.format("%02X", b)); } return builder.toString(); } private  StringUtils(); static String byteToHex(byte[] data); static String replaceLineBreaksWithSpace(String string); static String collapseLineBreaks(String string); static String replaceLineBreaks(String string, String replace); static String removeWhiteSpaces(String string); static String tryTrim(String string); static int getLevenshteinDistance(CharSequence s, CharSequence t); static String join(Object[] array, char separator); static String join(Object[] array, char separator, int startIndex, int endIndex); static String join(Iterator<T> iterator, String separator); static String join(Collection<T> collection, String separator); }
StringUtils { public static String byteToHex(byte[] data) { if (data == null) { return null; } final StringBuilder builder = new StringBuilder(); for (final byte b : data) { builder.append(String.format("%02X", b)); } return builder.toString(); } private  StringUtils(); static String byteToHex(byte[] data); static String replaceLineBreaksWithSpace(String string); static String collapseLineBreaks(String string); static String replaceLineBreaks(String string, String replace); static String removeWhiteSpaces(String string); static String tryTrim(String string); static int getLevenshteinDistance(CharSequence s, CharSequence t); static String join(Object[] array, char separator); static String join(Object[] array, char separator, int startIndex, int endIndex); static String join(Iterator<T> iterator, String separator); static String join(Collection<T> collection, String separator); static final String EMPTY; static final String SPACE; }