Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.nio.DoubleBuffer;
import java.util.Arrays;

public class Main {
    private static final int BSIZE = 10;

    public static void main(String[] args) {
        DoubleBuffer bb = DoubleBuffer.allocate(BSIZE);
        bb.put(98765);
        bb.put(98765);
        bb.put(98765);
        bb.put(98765);
        bb.put(98765);

        bb.rewind();

        double[] doubleArray = new double[BSIZE];

        bb.get(doubleArray, 0, 2);

        System.out.println(Arrays.toString(doubleArray));

    }
}