Here you can find the source of bytesToHexStr(byte[] bcd)
private static final String bytesToHexStr(byte[] bcd)
//package com.java2s; public class Main { private static final char[] bcdLookup = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; private static final String bytesToHexStr(byte[] bcd) { StringBuffer s = new StringBuffer(bcd.length * 2); for (int i = 0; i < bcd.length; i++) { s.append(bcdLookup[(bcd[i] >>> 4) & 0x0f]); s.append(bcdLookup[bcd[i] & 0x0f]); }//from w w w. j a v a 2s .c om return s.toString(); } }