Here you can find the source of convertFloatFromBytes(byte[] byteArray)
public static float convertFloatFromBytes(byte[] byteArray)
//package com.java2s; public class Main { public static float convertFloatFromBytes(byte[] byteArray) { return convertFloatFromBytes(byteArray, 0); }// w w w .j a va2 s.c o m public static float convertFloatFromBytes(byte[] byteArray, int offset) { // Convert it to an int int number = convertIntFromBytes(byteArray, offset); return Float.intBitsToFloat(number); } public static int convertIntFromBytes(byte[] byteArray) { return convertIntFromBytes(byteArray, 0); } public static int convertIntFromBytes(byte[] byteArray, int offset) { // Convert it to an int int number = ((byteArray[offset] & 0xFF) << 24) + ((byteArray[offset + 1] & 0xFF) << 16) + ((byteArray[offset + 2] & 0xFF) << 8) + (byteArray[offset + 3] & 0xFF); return number; } }