Here you can find the source of byteToString(byte[] b)
private static String byteToString(byte[] b)
//package com.java2s; //License from project: Open Source License public class Main { private final static String[] strDigits = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F" }; private static String byteToString(byte[] b) { StringBuffer strBuffer = new StringBuffer(); for (int i = 0; i < b.length; i++) { strBuffer.append(strDigits[(b[i] & 0xf0) >>> 4]); strBuffer.append(strDigits[b[i] & 0x0f]); }/*www . j a v a 2 s.co m*/ return strBuffer.toString(); } }