Here you can find the source of bytesToFloat(byte[] b)
public static float bytesToFloat(byte[] b)
//package com.java2s; /**/*from w ww . j a v a 2s . com*/ * Copyright @ 2007, ST Electronics Info-comm Systems PTE. LTD All rights * reserved. * * This software is confidential and proprietary property of ST Electronics * Info-comm Systems PTE. LTD. The user shall not disclose the contents of this * software and shall only use it in accordance with the terms and conditions * stated in the contract or licence agreement with ST Electronics Info-comm * Systems PTE. LTD. * * @author Jerry * @version 1.0 * */ public class Main { public static float bytesToFloat(byte[] b) { return Float.intBitsToFloat(bytesToInt(b)); } public static int bytesToInt(byte[] b) { int i = (b[0] << 24) & 0xFF000000; i |= (b[1] << 16) & 0xFF0000; i |= (b[2] << 8) & 0xFF00; i |= b[3] & 0xFF; return i; } }