Java Utililty Methods IntBuffer Create

List of utility methods to do IntBuffer Create

Description

The list of methods to do IntBuffer Create are organized into topic(s).

Method

IntBuffercreateIntBuffer(final int... data)
Generate a new IntBuffer using the given array of ints.
if (data == null) {
    return null;
final IntBuffer buff = createIntBuffer(data.length);
buff.clear();
buff.put(data);
buff.flip();
return buff;
...
IntBuffercreateIntBuffer(final int... data)
create Int Buffer
if (data == null) {
    return null;
final IntBuffer buff = createIntBuffer(data.length);
buff.clear();
buff.put(data);
buff.flip();
return buff;
...
IntBuffercreateIntBuffer(int capacity)
create Int Buffer
return createByteBuffer(capacity * Integer.BYTES).asIntBuffer();
IntBuffercreateIntBuffer(int size)
Constructs a direct native-order intbuffer with the specified number of elements.
return (createByteBuffer(size << 2).asIntBuffer());
IntBuffercreateIntBuffer(int size)
Construct a direct native-order intbuffer with the specified number of elements.
return createByteBuffer(size << 2).asIntBuffer();
IntBuffercreateIntBuffer(int size)
create Int Buffer
return createByteBuffer(size * Integer.BYTES).asIntBuffer();
IntBuffercreateIntBuffer(int... data)
Generate a new IntBuffer using the given array of ints.
if (data == null)
    return null;
IntBuffer buff = createIntBuffer(data.length);
buff.clear();
buff.put(data);
buff.flip();
return buff;
IntBuffercreateIntBuffer(int[] array)
create Int Buffer
IntBuffer result = ByteBuffer.allocateDirect(array.length << 2).order(ByteOrder.nativeOrder())
        .asIntBuffer();
result.put(array).flip();
return result;
IntBuffercreateIntBufferOnHeap(final int size)
Create a new IntBuffer of the specified size.
final IntBuffer buf = ByteBuffer.allocate(4 * size).order(ByteOrder.nativeOrder()).asIntBuffer();
buf.clear();
return buf;
IntBuffernewDirectIntBuffer(final int theSize)
new Direct Int Buffer
ByteBuffer myBuffer = ByteBuffer.allocateDirect(theSize * SIZE_OF_INT);
myBuffer.order(ByteOrder.nativeOrder());
return myBuffer.asIntBuffer();