Here you can find the source of toFloatArray(final double[] doubleArray)
static float[] toFloatArray(final double[] doubleArray)
//package com.java2s; //License from project: Apache License public class Main { static float[] toFloatArray(final double[] doubleArray) { if (doubleArray == null) { return null; } else {//w ww . j av a 2 s .co m final int size = doubleArray.length; final float[] floatArray = new float[size]; for (int i = 0; i < size; i++) { floatArray[i] = (float) doubleArray[i]; } return floatArray; } } }