Example usage for java.nio LongBuffer compareTo

List of usage examples for java.nio LongBuffer compareTo

Introduction

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

Prototype

public int compareTo(LongBuffer otherBuffer) 

Source Link

Document

Compare the remaining longs of this buffer to another long buffer's remaining longs.

Usage

From source file:Main.java

public static void main(String[] args) {
    LongBuffer longBuffer = LongBuffer.allocate(10);
    longBuffer.put(100);//  w ww  .j  ava 2  s . co  m

    longBuffer.rewind();

    LongBuffer longBuffer2 = longBuffer.compact();

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

}