Java IO Tutorial - Java LongBuffer.put(int index, long l)








Syntax

LongBuffer.put(int index, long l) has the following syntax.

public abstract LongBuffer put(int index,  long l)

Example

In the following code shows how to use LongBuffer.put(int index, long l) method.

/*  w w  w. j av a  2s.  com*/
import java.nio.LongBuffer;

public class Main {
  public static void main(String[] args) {
    LongBuffer bb = LongBuffer.allocate(10);
    bb.put(0,123L);
    System.out.println(bb.arrayOffset());

  }
}

The code above generates the following result.