List of utility methods to do IntBuffer Create
void | copy(float[] src, IntBuffer dst, int numFloats, int offset) copy dst.clear(); dst.limit(numFloats); for (int i = offset; i < offset + numFloats && i < src.length; i++) { dst.put(Float.floatToRawIntBits(src[i])); dst.flip(); |
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 | createIntBuffer(int capacity) Creates a IntBuffer with the specified capacity. return createByteBuffer(capacity * 4).asIntBuffer();
|
IntBuffer | createIntBuffer(int count) create Int Buffer ByteBuffer data = ByteBuffer.allocateDirect(count * 4);
data.order(ByteOrder.nativeOrder());
IntBuffer p1 = data.asIntBuffer();
return p1;
|
IntBuffer | createIntBuffer(int size) create Int Buffer ByteBuffer bf = ByteBuffer.allocateDirect(size * 4);
return bf.order(ByteOrder.nativeOrder()).asIntBuffer();
|
IntBuffer | createIntBuffer(int[] data) Creates a IntBuffer from the specified int array. IntBuffer b = createIntBuffer(data.length);
b.put(data);
b.rewind();
return b;
|
IntBuffer | getIntegerBuffer(int[] list) Genera un IntBuffer a partir de un array de integers ByteBuffer bb = ByteBuffer.allocateDirect(list.length
* Integer.SIZE / 8);
bb.order(ByteOrder.nativeOrder());
IntBuffer ib = bb.asIntBuffer();
ib.put(list);
ib.position(0);
return ib;
|
IntBuffer | makeIntBuffer(int size) make Int Buffer ByteBuffer bb = ByteBuffer.allocateDirect(size * 4);
bb.order(ByteOrder.nativeOrder());
IntBuffer Ib = bb.asIntBuffer();
Ib.position(0);
return Ib;
|
IntBuffer | makeIntBuffer(int[] arr) make Int Buffer ByteBuffer bb = ByteBuffer.allocateDirect(arr.length * 4);
bb.order(ByteOrder.nativeOrder());
IntBuffer Ib = bb.asIntBuffer();
Ib.put(arr);
Ib.position(0);
return Ib;
|