Here you can find the source of toIntFromTwoBytes(byte[] b, int pos)
public static int toIntFromTwoBytes(byte[] b, int pos)
//package com.java2s; public class Main { public static int toIntFromTwoBytes(byte[] b, int pos) { int ret = 0; ret |= (b[pos] & 0xFF);/*from w w w. j ava 2 s.c om*/ ret |= (b[pos + 1] & 0xFF) << 8; return (int) ret; } }