Here you can find the source of bytesToInt(byte[] in)
public static int bytesToInt(byte[] in)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static int bytesToInt(byte[] in) { return ByteBuffer.wrap(in).getInt(); //note: big-endian by default }//from www.j av a2 s . c om }