Here you can find the source of bytesToInt(int off, byte... arr)
public static int bytesToInt(int off, byte... arr)
//package com.java2s; public class Main { public static int bytesToInt(int off, byte... arr) { int n = 0; for (int i = 0; i < 4; i++) { n |= (arr[i + off] & 0xFF) << 8 * i; }//from w w w . j a va2 s.com return n; } }