Java examples for java.lang:String Hex
Convert byte array to Hex Char Array
//package com.java2s; public class Main { public static char[] toHexCharArray(byte[] input) { int m = input.length; int n = 2 * m; int l = 0; char[] output = new char[n]; for (int k = 0; k < m; k++) { byte v = input[k]; int i = (v >> 4) & 0xf; output[l++] = (char) (i >= 10 ? ('a' + i - 10) : ('0' + i)); i = v & 0xf;/*from w w w . j av a 2s . c o m*/ output[l++] = (char) (i >= 10 ? ('a' + i - 10) : ('0' + i)); } return output; } }