@Test public void testHex() { assertArrayEquals(new byte[] {0, 0x66, -1}, StringUtils.parseHex("0066FF")); }
public static String hex(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; for (int i = 0; i < bytes.length; i++) { int value = bytes[i] & 0xFF; hexChars[i * 2] = HEX_CHARS[value >>> 4]; hexChars[i * 2 + 1] = HEX_CHARS[value & 0x0F]; } return new String(hexChars); }
StringUtils { public static String hex(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; for (int i = 0; i < bytes.length; i++) { int value = bytes[i] & 0xFF; hexChars[i * 2] = HEX_CHARS[value >>> 4]; hexChars[i * 2 + 1] = HEX_CHARS[value & 0x0F]; } return new String(hexChars); } }
StringUtils { public static String hex(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; for (int i = 0; i < bytes.length; i++) { int value = bytes[i] & 0xFF; hexChars[i * 2] = HEX_CHARS[value >>> 4]; hexChars[i * 2 + 1] = HEX_CHARS[value & 0x0F]; } return new String(hexChars); }  }
StringUtils { public static String hex(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; for (int i = 0; i < bytes.length; i++) { int value = bytes[i] & 0xFF; hexChars[i * 2] = HEX_CHARS[value >>> 4]; hexChars[i * 2 + 1] = HEX_CHARS[value & 0x0F]; } return new String(hexChars); }  static String[] split(String string, char delimiter); static String encodeUrl(String stringToEncode); static String encodeUrlIso(String stringToEncode); static String decodeUrl(String stringToDecode); static String decodeUrlIso(String stringToDecode); static String md5(String stringToEncode); static String sha1(String stringToEncode); static String digest(String string, String digestAlgo, String encoding); static String hex(byte[] bytes); static byte[] parseHex(String hex); static int parseHexDigit(char c); static String resolveEntity(String entity); static String ellipsize(String text, int maxLength); static String ellipsize(String text, int maxLength, String end); static String[] splitLines(String text, boolean skipEmptyLines); static List<String> findLinesContaining(String text, String searchText); static String join(Iterable<?> iterable, String separator); static String join(int[] array, String separator); static String join(String[] array, String separator); }
StringUtils { public static String hex(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; for (int i = 0; i < bytes.length; i++) { int value = bytes[i] & 0xFF; hexChars[i * 2] = HEX_CHARS[value >>> 4]; hexChars[i * 2 + 1] = HEX_CHARS[value & 0x0F]; } return new String(hexChars); }  static String[] split(String string, char delimiter); static String encodeUrl(String stringToEncode); static String encodeUrlIso(String stringToEncode); static String decodeUrl(String stringToDecode); static String decodeUrlIso(String stringToDecode); static String md5(String stringToEncode); static String sha1(String stringToEncode); static String digest(String string, String digestAlgo, String encoding); static String hex(byte[] bytes); static byte[] parseHex(String hex); static int parseHexDigit(char c); static String resolveEntity(String entity); static String ellipsize(String text, int maxLength); static String ellipsize(String text, int maxLength, String end); static String[] splitLines(String text, boolean skipEmptyLines); static List<String> findLinesContaining(String text, String searchText); static String join(Iterable<?> iterable, String separator); static String join(int[] array, String separator); static String join(String[] array, String separator);  }