Here you can find the source of byteToInt(byte b[])
public static int byteToInt(byte b[])
//package com.java2s; //License from project: Apache License public class Main { public static int byteToInt(byte b[]) { int s = 0; s = ((((b[0] & 0xff) << 8 | (b[1] & 0xff)) << 8) | (b[2] & 0xff)) << 8 | (b[3] & 0xff); return s; }/*from w w w. ja v a 2 s. com*/ }