Java IntBuffer.array()

Syntax

IntBuffer.array() has the following syntax.

public final int[] array()

Example

In the following code shows how to use IntBuffer.array() method.


//ww  w  .  jav  a2  s  .co m
import java.nio.IntBuffer;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    IntBuffer bb = IntBuffer.wrap(new int[] { 0, 1, 2, 3, 4, 5, 6 });
    bb.put(100);
    System.out.println(Arrays.toString(bb.array()));

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.nio »




Buffer
ByteBuffer
ByteOrder
CharBuffer
DoubleBuffer
FloatBuffer
IntBuffer
LongBuffer
MappedByteBuffer
ShortBuffer