Here you can find the source of readFourByteInt(ByteBuffer buffer, int start)
public static int readFourByteInt(ByteBuffer buffer, int start)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static int readFourByteInt(ByteBuffer buffer, int start) { final byte b1 = buffer.get(start); final byte b2 = buffer.get(start + 1); final byte b3 = buffer.get(start + 2); final byte b4 = buffer.get(start + 3); return ((b1 & 255) << 24) | ((b2 & 255) << 16) | ((b3 & 255) << 8) | (b4 & 255); }/* w w w . ja va 2 s .c o m*/ public static int readFourByteInt(byte[] array, int start) { return ((array[start] & 255) << 24) | ((array[start + 1] & 255) << 16) | ((array[start + 2] & 255) << 8) | (array[start + 3] & 255); } }