Example usage for java.nio ShortBuffer compareTo

List of usage examples for java.nio ShortBuffer compareTo

Introduction

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

Prototype

public int compareTo(ShortBuffer otherBuffer) 

Source Link

Document

Compare the remaining shorts of this buffer to another short buffer's remaining shorts.

Usage

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer shortBuffer = ShortBuffer.allocate(10);
    shortBuffer.put((short) 100);

    shortBuffer.rewind();//from  w ww.  j  a v  a 2s. c  o m

    ShortBuffer shortBuffer2 = shortBuffer.compact();

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

}