private static java.nio.ByteBuffer allocate0( int capacity, boolean direct )
{
Stack[] bufferStacks = direct? directBufferStacks : heapBufferStacks;
int idx = getBufferStackIndex( bufferStacks, capacity );
Stack stack = bufferStacks[ idx ];
java.nio.ByteBuffer buf;
synchronized( stack )
{
buf = ( java.nio.ByteBuffer ) stack.pop();
}
if( buf == null )
{
buf = direct ? java.nio.ByteBuffer.allocateDirect( MINIMUM_CAPACITY << idx ) :