Example usage for java.nio FloatBuffer compareTo

List of usage examples for java.nio FloatBuffer compareTo

Introduction

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

Prototype

public int compareTo(FloatBuffer otherBuffer) 

Source Link

Document

Compare the remaining floats of this buffer to another float buffer's remaining floats.

Usage

From source file:Main.java

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

    floatBuffer.put(0, 1.23F);//  w w w . j av a 2 s  .co  m

    floatBuffer.rewind();

    FloatBuffer floatBuffer1 = floatBuffer.compact();

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

}