Here you can find the source of byteArrayToInt(byte[] bytes)
public static int byteArrayToInt(byte[] bytes)
//package com.java2s; public class Main { public static int byteArrayToInt(byte[] bytes) { int value = 0; for (int i = 0; i < 4; i++) { int shift = (4 - 1 - i) * 8; value += (bytes[i] & 0x000000FF) << shift; }// w w w.j a v a 2s .com return value; } }