Java IO Tutorial - Java LongBuffer.array()








Syntax

LongBuffer.array() has the following syntax.

public final long[] array()

Example

In the following code shows how to use LongBuffer.array() method.

//from  w w  w.jav a  2 s.  c  o  m
import java.nio.LongBuffer;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    LongBuffer bb = LongBuffer.wrap(new long[] { 0, 1, 2, 3, 4, 5, 6 });
    bb.put(100);
    System.out.println(Arrays.toString(bb.array()));

  }
}

The code above generates the following result.