Here you can find the source of intFromBytes(byte[] buffer)
public static int intFromBytes(byte[] buffer)
//package com.java2s; //License from project: Open Source License public class Main { public static int intFromBytes(byte[] buffer) { return intFromBytes(buffer, 0, 4); }// w w w . j a v a 2s. c om public static int intFromBytes(byte[] buffer, int startPosition, int length) { int result = 0; for (int idx = startPosition + length - 1; idx >= startPosition; idx--) result = (result << 8) | (((int) buffer[idx]) & 0xFF); return result; } }