Here you can find the source of bcd2String(byte[] bytes)
private static String bcd2String(byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { private static String bcd2String(byte[] bytes) { char temp[] = new char[bytes.length * 2], val; for (int i = 0; i < bytes.length; i++) { val = (char) (((bytes[i] & 0xf0) >> 4) & 0x0f); temp[i * 2] = (char) (val > 9 ? val + 'A' - 10 : val + '0'); val = (char) (bytes[i] & 0x0f); temp[i * 2 + 1] = (char) (val > 9 ? val + 'A' - 10 : val + '0'); }/*w ww . j a v a2s . com*/ return new String(temp); } }