Example usage for java.nio LongBuffer slice

List of usage examples for java.nio LongBuffer slice

Introduction

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

Prototype

public abstract LongBuffer 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) {
    LongBuffer longBuffer = LongBuffer.allocate(10);
    longBuffer.put(100);/*from w w w. j av a  2  s .  c o m*/

    longBuffer.rewind();

    LongBuffer longBuffer2 = longBuffer.slice();

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

}