Example usage for java.nio ShortBuffer duplicate

List of usage examples for java.nio ShortBuffer duplicate

Introduction

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

Prototype

public abstract ShortBuffer duplicate();

Source Link

Document

Returns a duplicated buffer that shares its content with this buffer.

Usage

From source file:Main.java

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

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

    ShortBuffer shortBuffer2 = shortBuffer.duplicate();

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

}