Here you can find the source of byteToInt(byte[] i_Value)
public static int byteToInt(byte[] i_Value)
//package com.java2s; //License from project: Open Source License public class Main { public static int byteToInt(byte[] i_Value) { if (i_Value.length >= 4) { return (((i_Value[0] & 0xFF) << 24) + ((i_Value[1] & 0xFF) << 16) + ((i_Value[2] & 0xFF) << 8) + ((i_Value[3] & 0xFF) << 0)); } else if (i_Value.length == 3) { return (((i_Value[0] & 0xFF) << 16) + ((i_Value[1] & 0xFF) << 8) + ((i_Value[2] & 0xFF) << 0)); } else if (i_Value.length == 2) { return (((i_Value[0] & 0xFF) << 8) + ((i_Value[1] & 0xFF) << 0)); } else if (i_Value.length == 1) { return (((i_Value[0] & 0xFF) << 0)); } else {/* w w w . j ava 2 s .c om*/ return 0; } } }