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