Here you can find the source of byteToHexStr(byte b)
private static String byteToHexStr(byte b)
//package com.java2s; public class Main { private static String byteToHexStr(byte b) { char[] digit = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; char[] tempArr = new char[2]; tempArr[0] = digit[(b >>> 4) & 0x0F]; tempArr[1] = digit[b & 0x0F]; return new String(tempArr); }/*from w ww .j a va2s . c o m*/ }