Java DoubleBuffer.put(double[] src, int offset, int length)

Syntax

DoubleBuffer.put(double[] src, int offset, int length) has the following syntax.

public DoubleBuffer put(double[] src,  int offset,  int length)

Example

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


/*from w  ww.ja  v  a  2 s.  c om*/
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},0,1);
    
    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