Java DoubleBuffer.wrap(double[] array, int offset, int length)

Syntax

DoubleBuffer.wrap(double[] array, int offset, int length) has the following syntax.

public static DoubleBuffer wrap(double[] array,  int offset,  int length)

Example

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


import java.nio.DoubleBuffer;
import java.util.Arrays;
//w w  w  . ja  va 2s  . c o m
public class Main {
  public static void main(String[] args) {
    DoubleBuffer bb = DoubleBuffer.wrap(new double[]{98765,98765},0,1);

    
    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