Here you can find the source of convertIntFromBytes(byte[] byteArray)
public static int convertIntFromBytes(byte[] byteArray)
//package com.java2s; public class Main { public static int convertIntFromBytes(byte[] byteArray) { return convertIntFromBytes(byteArray, 0); }// w ww . j a va 2 s . c o m public static int convertIntFromBytes(byte[] byteArray, int offset) { // Convert it to an int int number = ((byteArray[offset] & 0xFF) << 24) + ((byteArray[offset + 1] & 0xFF) << 16) + ((byteArray[offset + 2] & 0xFF) << 8) + (byteArray[offset + 3] & 0xFF); return number; } }