Here you can find the source of byteToStr(byte[] byteArray)
private static String byteToStr(byte[] byteArray)
//package com.java2s; //License from project: Open Source License public class Main { private static char[] digit = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; private static String byteToStr(byte[] byteArray) { String strDigest = ""; for (int i = 0; i < byteArray.length; i++) { strDigest += byteToHexStr(byteArray[i]); }/*from w w w.ja v a 2 s .co m*/ return strDigest; } private static String byteToHexStr(byte mByte) { char[] tempArr = new char[2]; tempArr[0] = digit[(mByte >>> 4) & 0X0F]; tempArr[1] = digit[mByte & 0X0F]; String s = new String(tempArr); return s; } }