Here you can find the source of bytes2Int(byte[] bytes)
public static int bytes2Int(byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { public static int bytes2Int(byte[] bytes) { int result = 0; for (int i = 0; i < 4; i++) //result += (bytes[i] & 0xffff) << 8*i ; result += bytes[i] << 8 * (4 - i - 1); return result; }//from w w w . j av a 2s . c o m }