Here you can find the source of toFloatA(byte[] data)
public static float[] toFloatA(byte[] data)
//package com.java2s; //License from project: Open Source License public class Main { public static float[] toFloatA(byte[] data) { if (data == null || data.length % 4 != 0) return null; // ---------- float[] flts = new float[data.length / 4]; for (int i = 0; i < flts.length; i++) { flts[i] = toFloat(new byte[] { data[(i * 4)], data[(i * 4) + 1], data[(i * 4) + 2], data[(i * 4) + 3], }); }// w ww . j a va 2 s .c o m return flts; } public static float toFloat(byte[] data) { if (data == null || data.length != 4) return 0x0; // ---------- simple: return Float.intBitsToFloat(toInt(data)); } public static int toInt(byte[] data) { if (data == null || data.length != 4) return 0x0; // ---------- return (int) ( // NOTE: type cast not necessary for int (0xff & data[0]) << 24 | (0xff & data[1]) << 16 | (0xff & data[2]) << 8 | (0xff & data[3]) << 0); } }