Example usage for java.nio LongBuffer asReadOnlyBuffer

List of usage examples for java.nio LongBuffer asReadOnlyBuffer

Introduction

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

Prototype

public abstract LongBuffer asReadOnlyBuffer();

Source Link

Document

Returns a read-only 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 a v a 2  s  .  c  o m

    longBuffer.rewind();

    LongBuffer longBuffer2 = longBuffer.asReadOnlyBuffer();

    System.out.println(Arrays.toString(longBuffer2.array()));

}