Here you can find the source of toFloat(byte[] bytes)
public static float toFloat(byte[] bytes)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Shuichi Miura.// w w w. j a v a 2 s . co m * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html * * Contributors: * Shuichi Miura - initial API and implementation ******************************************************************************/ public class Main { public static float toFloat(byte[] bytes) { int intValue = toInt(bytes); return Float.intBitsToFloat(intValue); } public static int toInt(byte[] bytes) { return (bytes[3] & 0xff) + ((bytes[2] & 0xff) << 8) + ((bytes[1] & 0xff) << 16) + ((bytes[0] & 0xff) << 24); } }