List of usage examples for java.nio FloatBuffer mark
public final Buffer mark()
reset()
. From source file:Main.java
public static ByteBuffer copyFloatBufferAsByteBuffer(FloatBuffer buf) { ByteBuffer dest = newByteBuffer(buf.remaining() * SIZEOF_FLOAT); buf.mark(); dest.asFloatBuffer().put(buf);/* www . j a v a2 s . co m*/ buf.reset(); dest.rewind(); return dest; }