Here you can find the source of byteToInt(byte[] buf, int off)
public static int byteToInt(byte[] buf, int off)
//package com.java2s; //License from project: Open Source License public class Main { public static int byteToInt(byte[] buf, int off) { int ch1 = buf[0 + off] & 0xFF; int ch2 = buf[1 + off] & 0xFF; int ch3 = buf[2 + off] & 0xFF; int ch4 = buf[3 + off] & 0xFF; return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0)); }//w ww.j ava 2 s. c o m }