Example usage for java.nio FloatBuffer asReadOnlyBuffer

List of usage examples for java.nio FloatBuffer asReadOnlyBuffer

Introduction

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

Prototype

public abstract FloatBuffer 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) {
    FloatBuffer floatBuffer = FloatBuffer.allocate(10);

    floatBuffer.put(0, 1.23F);// ww w  .j av  a2  s  . co  m

    floatBuffer.rewind();

    FloatBuffer floatBuffer1 = floatBuffer.asReadOnlyBuffer();

    System.out.println(floatBuffer.equals(floatBuffer1));

}