Java DoubleBuffer.wrap(double[] array)

Syntax

DoubleBuffer.wrap(double[] array) has the following syntax.

public static DoubleBuffer wrap(double[] array)

Example

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


import java.nio.DoubleBuffer;
import java.util.Arrays;
/*from  w w  w  . ja v  a  2 s  .c  om*/
public class Main {
  public static void main(String[] args) {
    DoubleBuffer bb = DoubleBuffer.wrap(new double[]{98765,98765});

    
    bb.rewind();
    
    System.out.println(Arrays.toString(bb.array()));
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.nio »




Buffer
ByteBuffer
ByteOrder
CharBuffer
DoubleBuffer
FloatBuffer
IntBuffer
LongBuffer
MappedByteBuffer
ShortBuffer