Here you can find the source of intFromBytes(byte[] bytes)
public static int intFromBytes(byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { public static int intFromBytes(byte[] bytes) { int x1 = bytes[0]; int x2 = bytes[1]; int x3 = bytes[2]; int x4 = bytes[3]; if (x1 < 0) x1 = x1 + 256;/*from w ww . j a va 2 s . c o m*/ if (x2 < 0) x2 = x2 + 256; if (x3 < 0) x3 = x3 + 256; if (x4 < 0) x4 = x4 + 256; return ((x1 << 24) + (x2 << 16) + (x3 << 8) + x4); } }