Here you can find the source of byteToInt2(byte[] b)
public static int byteToInt2(byte[] b)
//package com.java2s; //License from project: Apache License public class Main { public static int byteToInt2(byte[] b) { int iOutcome = 0; byte bLoop; for (int i = 0; i < 4; i++) { bLoop = b[i];//from ww w. j a v a 2 s. co m int off = (b.length - 1 - i) * 8; iOutcome += (bLoop & 0xFF) << off; } return iOutcome; } }