Here you can find the source of byte2Integer(byte[] bin)
public static Integer byte2Integer(byte[] bin)
//package com.java2s; public class Main { public static Integer byte2Integer(byte bin) { return (Integer) (bin & 0xFF); }/* ww w. j a v a 2 s . co m*/ public static Integer byte2Integer(byte[] bin) { int mask = 0xff; int temp = 0; int n = 0; int size = bin.length; if (size <= 0) { return 0; } if (size < 2 && size > 0) { return byte2Integer(bin[0]); } for (int i = 0; i < bin.length; i++) { n <<= 8; temp = bin[i] & mask; n |= temp; } return n; } }