Here you can find the source of bytes2float(byte[] bytes)
public static float bytes2float(byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { public static float bytes2float(byte[] bytes) { return Float.intBitsToFloat(bytes2int(bytes)); }//from w w w . j a v a 2s.c o m public static float bytes2float(byte[] bytes, int offset) { return Float.intBitsToFloat(bytes2int(bytes, offset)); } public static int bytes2int(byte[] bytes) { return bytes2int(bytes, 0); } public static int bytes2int(byte[] bytes, int offset) { int result = bytes[offset + 3] & 0xFF; result = result ^ ((bytes[offset + 2] & 0xff) << 8); result = result ^ ((bytes[offset + 1] & 0xff) << 16); result = result ^ ((bytes[offset + 0] & 0xff) << 24); return result; } }