Android IntBuffer Create toIntBuffer(int[] array)

Here you can find the source of toIntBuffer(int[] array)

Description

to Int Buffer

License

Apache License

Declaration

public static IntBuffer toIntBuffer(int[] array) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.nio.*;

public class Main {
    public static IntBuffer toIntBuffer(int[] array) {
        ByteBuffer bb = ByteBuffer.allocateDirect(array.length << 2);
        bb.order(ByteOrder.nativeOrder());
        bb.position(0);/*  w  w  w.j a v  a2s.co m*/
        IntBuffer ibb = bb.asIntBuffer();
        ibb.put(array);
        return ibb;
    }
}

Related

  1. makeIntBuffer(int[] arr)
  2. newIntBuffer(int numInts)
  3. newIntBuffer(int numInts)
  4. newIntBuffer(int paramInt)
  5. setupIntBuffer(IntBuffer preBuffer, int[] array)
  6. createDirectIntBuffer(final int capacity)
  7. createDirectIntBuffer(final int capacity, final IntBuffer previous)
  8. buildIntBuffer(int[] buffer)
  9. makeIntBuffer(int[] array)