Java DoubleBuffer.put(int index, double d)

Syntax

DoubleBuffer.put(int index, double d) has the following syntax.

public abstract DoubleBuffer put(int index,  double d)

Example

In the following code shows how to use DoubleBuffer.put(int index, double d) method.


//  w w  w .  j a  v a 2s. 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(0,98765);
    
    
    
    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