Java IO Tutorial - Java LongBuffer.put(long l)








Syntax

LongBuffer.put(long l) has the following syntax.

public abstract LongBuffer put(long l)

Example

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

import java.nio.LongBuffer;
/*from  w  w  w  . j  av a2s  . c o  m*/
public class Main {
  public static void main(String[] args) {
    LongBuffer bb = LongBuffer.allocate(10);
    bb.put(100L);
    System.out.println(bb.arrayOffset());

  }
}

The code above generates the following result.