Here you can find the source of byteToHexString(byte ib)
protected static String byteToHexString(byte ib)
//package com.java2s; //License from project: Apache License public class Main { protected static String byteToHexString(byte ib) { char[] Digit = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; char[] ob = new char[2]; ob[0] = Digit[(ib >>> 4) & 0X0f]; ob[1] = Digit[ib & 0X0F];/*from w ww. j a v a 2 s . c om*/ String s = new String(ob); return s; } }