Here you can find the source of readTwoByteInt(byte[] array, int start)
public static int readTwoByteInt(byte[] array, int start)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static int readTwoByteInt(ByteBuffer buffer, int start) { final byte b1 = buffer.get(start); final byte b2 = buffer.get(start + 1); return ((b1 & 255) << 8) + (b2 & 255); }/* w w w . j a v a 2 s . co m*/ public static int readTwoByteInt(byte[] array, int start) { return ((array[start] & 255) << 8) + (array[start + 1] & 255); } }