Here you can find the source of getIntegerBuffer(int[] list)
Parameter | Description |
---|---|
lista | de integers |
public static IntBuffer getIntegerBuffer(int[] list)
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; public class Main { /**/*w w w.jav a 2s . c o m*/ * Genera un IntBuffer a partir de un array de integers * @param lista de integers * @return IntBuffer resultante */ public static IntBuffer getIntegerBuffer(int[] list) { 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; } }