Here you can find the source of toFloatArray(final byte[] array)
public static float[] toFloatArray(final byte[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static float[] toFloatArray(final byte[] array) { return toFloatArray(array, 0, array.length); }// w w w .j a va2 s . co m public static float[] toFloatArray(final byte[] array, final int off, final int len) { return toFloatArray(array, off, len, new float[len], 0); } public static float[] toFloatArray(final byte[] from, final int fromOff, final int len, final float[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static float[] toFloatArray(final char[] array) { return toFloatArray(array, 0, array.length); } public static float[] toFloatArray(final char[] array, final int off, final int len) { return toFloatArray(array, off, len, new float[len], 0); } public static float[] toFloatArray(final char[] from, final int fromOff, final int len, final float[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static float[] toFloatArray(final short[] array) { return toFloatArray(array, 0, array.length); } public static float[] toFloatArray(final short[] array, final int off, final int len) { return toFloatArray(array, off, len, new float[len], 0); } public static float[] toFloatArray(final short[] from, final int fromOff, final int len, final float[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static float[] toFloatArray(final int[] array) { return toFloatArray(array, 0, array.length); } public static float[] toFloatArray(final int[] array, final int off, final int len) { return toFloatArray(array, off, len, new float[len], 0); } public static float[] toFloatArray(final int[] from, final int fromOff, final int len, final float[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static float[] toFloatArray(final long[] array) { return toFloatArray(array, 0, array.length); } public static float[] toFloatArray(final long[] array, final int off, final int len) { return toFloatArray(array, off, len, new float[len], 0); } public static float[] toFloatArray(final long[] from, final int fromOff, final int len, final float[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static float[] toFloatArray(final double[] array) { return toFloatArray(array, 0, array.length); } public static float[] toFloatArray(final double[] array, final int off, final int len) { return toFloatArray(array, off, len, new float[len], 0); } public static float[] toFloatArray(final double[] from, final int fromOff, final int len, final float[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = (float) from[i]; } return to; } }