Here you can find the source of createByteBuffer(int size)
public static ByteBuffer createByteBuffer(int size)
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { public static ByteBuffer createByteBuffer(int size) { ByteBuffer bf = ByteBuffer.allocateDirect(size); return bf.order(ByteOrder.nativeOrder()); }// w w w. ja va2 s .c om }