Java IO Tutorial - Java IntBuffer.get(int[] dst)








Syntax

IntBuffer.get(int[] dst) has the following syntax.

public IntBuffer get(int[] dst)

Example

In the following code shows how to use IntBuffer.get(int[] dst) method.

import java.nio.IntBuffer;
import java.util.Arrays;
/*from  w w  w .j a  v a  2 s.c  o m*/
public class Main {
  public static void main(String[] args) {
    IntBuffer bb = IntBuffer.allocate(10);
    bb.put(100);
    
    bb.rewind();
    
    int[] intArray = new int[10];
    bb.get(intArray);
    
    System.out.println(Arrays.toString(intArray));

  }
}

The code above generates the following result.