Java IO Tutorial - Java IntBuffer.get(int index)








Syntax

IntBuffer.get(int index) has the following syntax.

public abstract int get(int index)

Example

In the following code shows how to use IntBuffer.get(int index) method.

import java.nio.IntBuffer;
//from   w  ww.  ja v  a 2s .c  o m
public class Main {
  public static void main(String[] args) {
    IntBuffer bb = IntBuffer.allocate(10);
    bb.put(100);
    
    bb.rewind();
    System.out.println(bb.get(0));

  }
}

The code above generates the following result.