Here you can find the source of writeLong(long v, ByteBuffer buffer)
public static void writeLong(long v, 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 void writeLong(long v, ByteBuffer buffer) throws IOException { buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.putLong(v);//from w w w . ja v a 2 s . co m buffer.order(ByteOrder.BIG_ENDIAN); } }