Android 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

IntBuffernewIntBuffer(int numInts)
new Int Buffer
ByteBuffer buffer = ByteBuffer.allocateDirect(numInts * 4);
buffer.order(ByteOrder.nativeOrder());
return buffer.asIntBuffer();
IntBuffernewIntBuffer(int numInts)
new Int Buffer
ByteBuffer buffer = ByteBuffer.allocateDirect(numInts * 4);
buffer.order(ByteOrder.nativeOrder());
return buffer.asIntBuffer();
IntBuffernewIntBuffer(int paramInt)
new Int Buffer
ByteBuffer localByteBuffer = newByteBuffer(paramInt * 4);
return localByteBuffer.asIntBuffer();
BuffersetupIntBuffer(IntBuffer preBuffer, int[] array)
setup Int Buffer
if (preBuffer == null || preBuffer.capacity() < array.length) {
    preBuffer = createIntBuffer(array.length * 2);
} else {
    preBuffer.clear();
preBuffer.clear();
preBuffer.put(array);
preBuffer.position(0);
...
IntBuffertoIntBuffer(int[] array)
to Int Buffer
ByteBuffer bb = ByteBuffer.allocateDirect(array.length << 2);
bb.order(ByteOrder.nativeOrder());
bb.position(0);
IntBuffer ibb = bb.asIntBuffer();
ibb.put(array);
return ibb;
IntBuffercreateDirectIntBuffer(final int capacity)
create Direct Int Buffer
return createDirectByteBuffer(capacity * BYTES_PER_INT)
        .asIntBuffer();
IntBuffercreateDirectIntBuffer(final int capacity, final IntBuffer previous)
create Direct Int Buffer
final IntBuffer created = createDirectIntBuffer(capacity);
if (null != previous) {
    previous.flip();
    created.put(previous);
return created;
IntBufferbuildIntBuffer(int[] buffer)
build IntBuffer: int[] -> IntBuffer
IntBuffer ret = null;
if (buffer != null) {
    ByteBuffer byteBuffer = ByteBuffer
            .allocateDirect(buffer.length * 4);
    byteBuffer.order(ByteOrder.nativeOrder());
    ret = byteBuffer.asIntBuffer();
    ret.put(buffer);
    ret.position(0);
...
IntBuffermakeIntBuffer(int[] array)
buffer methods
final int integerSize = Integer.SIZE / 8;
ByteBuffer byteBuffer = ByteBuffer.allocateDirect(array.length
        * integerSize);
byteBuffer.order(ByteOrder.nativeOrder());
IntBuffer intBuffer = byteBuffer.asIntBuffer();
intBuffer.put(array);
intBuffer.position(0);
return intBuffer;
...