import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
class MyFloatBuffer {
private final static ByteOrder BYTE_ORDER = ByteOrder.nativeOrder();
private final FloatBuffer floats;
public MyFloatBuffer(int capacity) {
floats = ByteBuffer.allocateDirect(capacity * 4).order(BYTE_ORDER)
.asFloatBuffer();
}
public final void put(float[] src) {
floats.put(src);
}
public final void flip() {
floats.flip();
}
public final Buffer asBuffer() {
return floats;
}
}