List of utility methods to do IntBuffer Create
IntBuffer | newIntBuffer(int numInts) new Int Buffer ByteBuffer buffer = ByteBuffer.allocateDirect(numInts * 4);
buffer.order(ByteOrder.nativeOrder());
return buffer.asIntBuffer();
|
IntBuffer | newIntBuffer(int numInts) new Int Buffer ByteBuffer buffer = ByteBuffer.allocateDirect(numInts * 4);
buffer.order(ByteOrder.nativeOrder());
return buffer.asIntBuffer();
|
IntBuffer | newIntBuffer(int paramInt) new Int Buffer ByteBuffer localByteBuffer = newByteBuffer(paramInt * 4);
return localByteBuffer.asIntBuffer();
|
Buffer | setupIntBuffer(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); ... |
IntBuffer | toIntBuffer(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;
|
IntBuffer | createDirectIntBuffer(final int capacity) create Direct Int Buffer return createDirectByteBuffer(capacity * BYTES_PER_INT)
.asIntBuffer();
|
IntBuffer | createDirectIntBuffer(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; |
IntBuffer | buildIntBuffer(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);
...
|
IntBuffer | makeIntBuffer(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; ... |