Here you can find the source of toInt(final byte lowOrderByte, final byte highOrderByte)
public static int toInt(final byte lowOrderByte, final byte highOrderByte)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { public static int toInt(final byte lowOrderByte, final byte highOrderByte) { return toInt(lowOrderByte, highOrderByte, ByteOrder.LITTLE_ENDIAN); }/*from w w w .j a v a 2s .co m*/ public static int toInt(final byte lowOrderByte, final byte highOrderByte, final ByteOrder byteOrder) { ByteBuffer byteBuffer = ByteBuffer.allocateDirect(4); byteBuffer.order(byteOrder); byteBuffer.put(lowOrderByte); byteBuffer.put(highOrderByte); byteBuffer.put((byte) 0x00); byteBuffer.put((byte) 0x00); byteBuffer.flip(); return byteBuffer.getInt(); } }