Java DoubleBuffer.get(double[] dst)

Syntax

DoubleBuffer.get(double[] dst) has the following syntax.

public DoubleBuffer get(double[] dst)

Example

In the following code shows how to use DoubleBuffer.get(double[] dst) method.


/*ww w.ja v  a  2s .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(98765);
    
    DoubleBuffer bb1 = DoubleBuffer.allocate(BSIZE);
    
    double[] doubleArray = new double[BSIZE];
    
    bb1.get(doubleArray);
    
    System.out.println(Arrays.toString(doubleArray));

    
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.nio »




Buffer
ByteBuffer
ByteOrder
CharBuffer
DoubleBuffer
FloatBuffer
IntBuffer
LongBuffer
MappedByteBuffer
ShortBuffer