Example usage for java.nio DoubleBuffer compact

List of usage examples for java.nio DoubleBuffer compact

Introduction

In this page you can find the example usage for java.nio DoubleBuffer compact.

Prototype

public abstract DoubleBuffer compact();

Source Link

Document

Compacts this double buffer.

Usage

From source file:Main.java

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

    bb.put(98765);//ww w. j a  va 2 s.  c o m

    DoubleBuffer bb1 = bb.compact();

    System.out.println(Arrays.toString(bb1.array()));

}

From source file:Main.java

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

    bb.put(98765);/*from  w  ww .  jav a2  s  .c  om*/

    DoubleBuffer bb1 = bb.compact();

    System.out.println(Arrays.toString(bb1.array()));

    System.out.println(bb.compareTo(bb1));

}