Here you can find the source of byteToInt(byte[] bytes)
public static int byteToInt(byte[] bytes)
//package com.java2s; public class Main { public static int byteToInt(byte[] bytes) { int num = 0; int temp; temp = (0x000000ff & (bytes[0])) << 0; num = num | temp;/*w w w . ja va 2 s . c o m*/ temp = (0x000000ff & (bytes[1])) << 8; num = num | temp; temp = (0x000000ff & (bytes[2])) << 16; num = num | temp; temp = (0x000000ff & (bytes[3])) << 24; num = num | temp; return num; } }