Here you can find the source of allocateNativeOrderDirectBuffer(int size)
public static ByteBuffer allocateNativeOrderDirectBuffer(int size)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { public static ByteBuffer allocateNativeOrderDirectBuffer(int size) { ByteBuffer buf = allocateBuffer(size, true); buf.order(ByteOrder.nativeOrder()); return buf; }/*from w ww . j a v a 2 s . c om*/ public static ByteBuffer allocateBuffer(int size, boolean isDirect) { final ByteBuffer buffer; if (isDirect) { buffer = ByteBuffer.allocateDirect(size); } else { buffer = ByteBuffer.allocate(size); } return buffer; } }