Here you can find the source of getIntFrom2ByteArray(final byte[] input)
public static int getIntFrom2ByteArray(final byte[] input)
//package com.java2s; import java.nio.ByteBuffer; public class Main { public static int getIntFrom2ByteArray(final byte[] input) { final byte[] result = new byte[4]; result[0] = 0;//from ww w .j ava2s . c o m result[1] = 0; result[2] = input[0]; result[3] = input[1]; return getIntFromByteArray(result); } public static int getIntFromByteArray(final byte[] byteArr) { return ByteBuffer.wrap(byteArr).getInt(); } }