Java IO Tutorial - Java DoubleBuffer.arrayOffset()


DoubleBuffer.arrayOffset() has the following syntax.

public final int arrayOffset()


In the following code shows how to use DoubleBuffer.arrayOffset() method.

//from   w  ww.  j av a  2 s.  c o  m
import java.nio.DoubleBuffer;
import java.util.Arrays;

public class Main {
  private static final int BSIZE = 1024;

  public static void main(String[] args) {
    DoubleBuffer bb = DoubleBuffer.allocate(BSIZE);

    bb.put(new double[]{98765,12345});


The code above generates the following result.