Here you can find the source of bytes2Int(byte[] b, int start, int len)
public static int bytes2Int(byte[] b, int start, int len)
//package com.java2s; //License from project: Apache License public class Main { public static int bytes2Int(byte[] b, int start, int len) { int sum = 0; int end = start + len; for (int i = start; i < end; i++) { int n = (int) b[i] & 0xff; n <<= (--len) * 8;/*from ww w .ja va 2 s. c om*/ sum = n + sum; } return sum; } }