Example usage for java.nio FloatBuffer compact

List of usage examples for java.nio FloatBuffer compact

Introduction

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

Prototype

public abstract FloatBuffer compact();

Source Link

Document

Compacts this float buffer.

Usage

From source file:Main.java

public static void main(String[] args) {
    FloatBuffer floatBuffer = FloatBuffer.allocate(10);

    floatBuffer.put(0, 1.23F);//from  w  w w  .j  a  v  a  2  s .c  o m

    floatBuffer.rewind();

    FloatBuffer floatBuffer1 = floatBuffer.compact();

    System.out.println(floatBuffer.equals(floatBuffer1));

}

From source file:Main.java

public static void main(String[] args) {
    FloatBuffer floatBuffer = FloatBuffer.allocate(10);

    floatBuffer.put(0, 1.23F);//from   w w w.ja v a 2s.com

    floatBuffer.rewind();

    FloatBuffer floatBuffer1 = floatBuffer.compact();

    System.out.println(floatBuffer.compareTo(floatBuffer1));

}