Here you can find the source of byteToArrayString(byte bByte)
private static String byteToArrayString(byte bByte)
//package com.java2s; //License from project: Apache 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 byteToArrayString(byte bByte) { int iRet = bByte; if (iRet < 0) { iRet += 256;/*from ww w . j a v a 2s . co m*/ } int iD1 = iRet / 16; int iD2 = iRet % 16; return strDigits[iD1] + strDigits[iD2]; } }