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  ww  w.  j  a  v a  2 s.  co  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.





















Home »
  Java Tutorial »
    java.nio »




Buffer
ByteBuffer
ByteOrder
CharBuffer
DoubleBuffer
FloatBuffer
IntBuffer
LongBuffer
MappedByteBuffer
ShortBuffer