Here you can find the source of byte2int(byte b[], int offset)
public static int byte2int(byte b[], int offset)
//package com.java2s; public class Main { /** *///from www .j a v a 2 s . c o m public static int byte2int(byte b[], int offset) { int val = 0; int bits = 32; int tval; for (int i = 0; i < 4; i++) { bits -= 8; tval = b[offset + i]; tval = tval < 0 ? 256 + tval : tval; val |= tval << bits; } return val; } }