Here you can find the source of toInt(byte[] b)
public static int toInt(byte[] b)
//package com.java2s; //License from project: Open Source License public class Main { public static int LENGTH_SIZE = 4; public static int toInt(byte[] b) { assert (b.length == LENGTH_SIZE); int n = 0; n |= ((b[0] & 0x000000FF) << 3 * 8); n |= ((b[1] & 0x000000FF) << 2 * 8); n |= ((b[2] & 0x000000FF) << 1 * 8); n |= (b[3] & 0x000000FF);/*from w w w . j a v a2s .co m*/ return n; } }