Here you can find the source of toInt(byte[] in)
public static int toInt(byte[] in)
//package com.java2s; //License from project: LGPL public class Main { public static int toInt(byte[] in) { int out = 0; for (int i = in.length - 1; i > 0; i--) { out |= in[i] & 0xff;/*from ww w . j a va 2 s. com*/ out <<= 8; } out |= in[0] & 0xff; return out; } }