Here you can find the source of toFloat(byte[] b, int off, boolean bigEndian)
public static float toFloat(byte[] b, int off, boolean bigEndian)
//package com.java2s; //License from project: Open Source License public class Main { public static float toFloat(byte[] b, int off, boolean bigEndian) { return Float.intBitsToFloat(toInt(b, off, bigEndian)); }// w w w . j a v a2 s. c o m public static void toFloat(float[] f, int fOff, byte[] b, int bOff, int bLen, boolean bigEndian) { int bEnd = bOff + bLen; for (int j = bOff, k = fOff; j < bEnd; j += 4, k++) { f[k] = toFloat(b, j, bigEndian); } } public static int toInt(byte[] b, int off, boolean bigEndian) { if (bigEndian) { return ((b[0] & 0xff) << 24) | ((b[1] & 0xff) << 16) | ((b[2] & 0xff) << 8) | ((b[3] & 0xff)); } else { return ((b[3] & 0xff) << 24) | ((b[2] & 0xff) << 16) | ((b[1] & 0xff) << 8) | ((b[0] & 0xff)); } } public static void toInt(int[] i, int iOff, byte[] b, int bOff, int bLen, boolean bigEndian) { int bEnd = bOff + bLen; for (int j = bOff, k = iOff; j < bEnd; j += 4, k++) { i[k] = toInt(b, j, bigEndian); } } }