Here you can find the source of BytesToInt(byte abyte0[], int offset)
public static int BytesToInt(byte abyte0[], int offset)
//package com.java2s; //License from project: Apache License public class Main { public static int BytesToInt(byte abyte0[], int offset) { return (int) to_number(abyte0, offset, 2); }//w ww.j a v a2 s . c o m static public final long to_number(byte[] p, int off, int len) { long ret = 0; int done = off + len; for (int i = off; i < done; i++) ret = ((ret << 8) & 0xffffffff) + (p[i] & 0xff); return ret; } }