Here you can find the source of ByteToInt(byte[] b)
public static int ByteToInt(byte[] b)
//package com.java2s; public class Main { public static int ByteToInt(byte[] b) { int targets = (b[0] & 0xff) | ((b[1] << 8) & 0xff00) | ((b[2] << 24) >>> 8) | (b[3] << 24); return targets; }//from w w w . j a v a 2 s.c om }