Example usage for java.nio ShortBuffer slice

List of usage examples for java.nio ShortBuffer slice

Introduction

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

Prototype

public abstract ShortBuffer slice();

Source Link

Document

Returns a sliced 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();//from  www  .  j  a v a  2s  .c  om

    ShortBuffer shortBuffer2 = shortBuffer.slice();

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

}