Java IO Tutorial - Java IntBuffer.get()








Syntax

IntBuffer.get() has the following syntax.

public abstract int get()

Example

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

//from   w w w.jav  a2 s  . c  o m
import java.nio.IntBuffer;

public class Main {
  public static void main(String[] args) {
    IntBuffer bb = IntBuffer.allocate(10);
    bb.put(100);
    
    bb.rewind();
    System.out.println(bb.get());

  }
}

The code above generates the following result.