Here you can find the source of newByteBuffer(int len)
public static ByteBuffer newByteBuffer(int len)
//package com.java2s; //License from project: Mozilla Public License import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { public static ByteBuffer newByteBuffer(int len) { return ByteBuffer.allocateDirect(len).order(ByteOrder.nativeOrder()); }//w w w.j av a2 s. co m }