Here you can find the source of getBCD4(byte[] b, int offset)
public static int getBCD4(byte[] b, int offset)
//package com.java2s; public class Main { public static int getBCD4(byte[] b, int offset) { int ret = (b[offset + 3] & 0x0f); ret += ((b[offset + 3] >>> 4) & 0x0f) * 10; ret += (b[offset + 2] & 0x0f) * 100; ret += ((b[offset + 2] >>> 4) & 0x0f) * 1000; ret += (b[offset + 1] & 0x0f) * 10000; ret += ((b[offset + 1] >>> 4) & 0x0f) * 100000; ret += (b[offset] & 0x0f) * 1000000; ret += ((b[offset] >>> 4) & 0x0f) * 10000000; return ret; }/*from www. jav a 2 s .co m*/ }