Here you can find the source of bytes2Float(byte[] b, float defaultValue)
public static float bytes2Float(byte[] b, float defaultValue)
//package com.java2s; //License from project: Open Source License public class Main { public static float bytes2Float(byte[] b, float defaultValue) { if (b == null || b.length < 4) { return defaultValue; } else {/*from www. jav a2 s. co m*/ return bytes2Float(b); } } public static float bytes2Float(byte[] b) { int l; l = b[0]; l &= 0xff; l |= ((long) b[1] << 8); l &= 0xffff; l |= ((long) b[2] << 16); l &= 0xffffff; l |= ((long) b[3] << 24); return Float.intBitsToFloat(l); } }