Here you can find the source of clone(FloatBuffer src)
static public FloatBuffer clone(FloatBuffer src)
//package com.java2s; //License from project: Open Source License import java.nio.*; public class Main { static public FloatBuffer clone(FloatBuffer src) { src.rewind();// w ww. j ava 2 s .c o m FloatBuffer copy = createFloatBuffer(src.limit()); copy.put(src); return copy; } static public FloatBuffer createFloatBuffer(int limit) { FloatBuffer buf = ByteBuffer.allocateDirect(4 * limit).order(ByteOrder.nativeOrder()).asFloatBuffer(); buf.clear(); return buf; } }