Java IO Tutorial - Java IntBuffer.put(int index, int i)








Syntax

IntBuffer.put(int index, int i) has the following syntax.

public abstract IntBuffer put(int index,  int i)

Example

In the following code shows how to use IntBuffer.put(int index, int i) method.

import java.nio.IntBuffer;
//from  www.  j av  a 2 s .  c o m
public class Main {
  public static void main(String[] args) {
    IntBuffer bb = IntBuffer.allocate(10);
    bb.put(1,100);
    System.out.println(bb.arrayOffset());

  }
}

The code above generates the following result.