Here you can find the source of allocaleByteBuffer(int capacity, boolean direct)
public static ByteBuffer allocaleByteBuffer(int capacity, boolean direct)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { public static ByteBuffer allocaleByteBuffer(int capacity, boolean direct) { return direct ? ByteBuffer.allocateDirect(capacity) : ByteBuffer.allocate(capacity); }/*from w w w .j a va2 s . com*/ }