Here you can find the source of bytesToInt(byte[] buf, int startIdx)
public static int bytesToInt(byte[] buf, int startIdx)
//package com.java2s; //License from project: Apache License public class Main { public static int bytesToInt(byte[] buf) { return ((0xff & buf[0]) << 24) | ((0xff & buf[1]) << 16) | ((0xff & buf[2]) << 8) | (0xff & buf[3]); }/*from w w w. j a v a 2s.c om*/ public static int bytesToInt(byte[] buf, int startIdx) { return ((0xff & buf[startIdx]) << 24) | ((0xff & buf[startIdx + 1]) << 16) | ((0xff & buf[startIdx + 2]) << 8) | (0xff & buf[startIdx + 3]); } }