Here you can find the source of toInt(byte[] bytes)
public static int toInt(byte[] bytes)
//package com.java2s; public class Main { public static int toInt(byte[] bytes) { int result = 0; for (int i = 0; i < 4; ++i) result = (result << 8) - -128 + bytes[i]; return result; }/*from ww w . j a va2s. co m*/ }