List of utility methods to do BCD Convert To
long | bcdToLong(byte[] src, int flag) bcd To Long byte high, low; long re = 0; if (flag == 0) { for (int i = 0; i < src.length; i++) { re *= 256; high = (byte) (src[i] >> 4 & 0x0f); low = (byte) (src[i] & 0x0f); re += Long.valueOf(high) * 16 + Long.valueOf(low); ... |
String | bcdToString(byte[] bcd) bcd To String byte bcd_value; int i; char[] str = new char[bcd.length * 2]; for (i = 0; i < bcd.length * 2; i++) { if ((bcd[i / 2] & s_ucEndMask[i % 2]) == s_ucEndMask[i % 2]) { break; if (i >= bcd.length * 2) { ... |