Example usage for java.nio IntBuffer compareTo

List of usage examples for java.nio IntBuffer compareTo

Introduction

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

Prototype

public int compareTo(IntBuffer otherBuffer) 

Source Link

Document

Compares the remaining ints of this buffer to another int buffer's remaining ints.

Usage

From source file:Main.java

public static void main(String[] args) {
    IntBuffer intBuffer = IntBuffer.allocate(10);
    intBuffer.put(100);/*from  w  w  w  .  j  av  a2s  . co m*/

    intBuffer.rewind();

    IntBuffer intBuffer2 = intBuffer.compact();

    System.out.println(intBuffer2.compareTo(intBuffer2));

}