Here you can find the source of readInt(ByteBuffer buffer)
public static int readInt(ByteBuffer buffer) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { public static int readInt(ByteBuffer buffer) throws IOException { buffer.order(ByteOrder.LITTLE_ENDIAN); int value = buffer.getInt(); buffer.order(ByteOrder.BIG_ENDIAN); return value; }/* w w w . ja v a2s. com*/ }