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) { return ByteBuffer.allocateDirect(size).order( ByteOrder.nativeOrder()); }/* www.j av a 2s . co m*/ }