Here you can find the source of bytes2int(byte[] data)
public static int bytes2int(byte[] data)
//package com.java2s; public class Main { public static int bytes2int(byte[] data) { int val = 0; val |= data[0] & 0x000000FF; val |= (data[1] << 8) & 0x0000FF00; val |= (data[2] << 16) & 0x00FF0000; val |= (data[3] << 24) & 0xFF000000; return val; }//from w w w . j a v a 2 s . com }