Here you can find the source of byteArrayToInt(byte[] b)
public static int byteArrayToInt(byte[] b)
//package com.java2s; public class Main { public static int byteArrayToInt(byte[] b) { if (b.length != 4) return 0; if (b.length != 4) return 0; int i = 0; int i1 = ((b[0] >= 0) ? b[0] : (b[0] + 256)) << 24; i = i + i1;/*from www.jav a2s.c o m*/ int i2 = ((b[1] >= 0) ? b[1] : (b[1] + 256)) << 16; i = i + i2; int i3 = ((b[2] >= 0) ? b[2] : (b[2] + 256)) << 8; i = i + i3; int i4 = (b[3] >= 0) ? b[3] : (b[3] + 256); i = i + i4; return i; } }