Example usage for java.nio FloatBuffer reset

List of usage examples for java.nio FloatBuffer reset

Introduction

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

Prototype

public final Buffer reset() 

Source Link

Document

Resets the position of this buffer to the mark.

Usage

From source file:Main.java

public static ByteBuffer copyFloatBufferAsByteBuffer(FloatBuffer buf) {
    ByteBuffer dest = newByteBuffer(buf.remaining() * SIZEOF_FLOAT);
    buf.mark();//w w w. j  a  v  a2  s  .c  o  m
    dest.asFloatBuffer().put(buf);
    buf.reset();
    dest.rewind();
    return dest;
}