Here you can find the source of readLong(ByteBuffer buffer)
public static long readLong(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 long readLong(ByteBuffer buffer) throws IOException { buffer.order(ByteOrder.LITTLE_ENDIAN); long value = buffer.getLong(); buffer.order(ByteOrder.BIG_ENDIAN); return value; }//www . j a v a 2s . c o m }