Java ByteBuffer Create allocaleByteBuffer(int capacity, boolean direct)

Here you can find the source of allocaleByteBuffer(int capacity, boolean direct)

Description

allocale Byte Buffer

License

Apache License

Declaration

public static ByteBuffer allocaleByteBuffer(int capacity, boolean direct) 

Method Source Code

//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*/
}

Related

  1. allocateByteBuffer(boolean useDirectBuffer, int bufSize)
  2. allocateByteBuffer(final int bytes)
  3. allocateByteBuffer(int capacity)
  4. createByteBuffer(byte... data)