Here you can find the source of bytesToFloat(byte[] b, int offset)
public static float bytesToFloat(byte[] b, int offset)
//package com.java2s; //License from project: Apache License public class Main { public static float bytesToFloat(byte[] b, int offset) { int l;/*from w w w. jav a2 s . co m*/ l = b[offset + 0]; l &= 0xff; l |= ((long) b[offset + 1] << 8); l &= 0xffff; l |= ((long) b[offset + 2] << 16); l &= 0xffffff; l |= ((long) b[offset + 3] << 24); return Float.intBitsToFloat(l); } public static float bytesToFloat(byte[] bytes) { return Float.intBitsToFloat(bytesToInt(bytes)); } public static int bytesToInt(byte[] bytes) { return (0xff & bytes[0]) | (0xff00 & (bytes[1] << 8)) | (0xff0000 & (bytes[2] << 16)) | (0xff000000 & (bytes[3] << 24)); } public static int bytesToInt(byte[] b, int offset) { return (0xff & b[offset]) | (0xff00 & (b[offset + 1] << 8)) | (0xff0000 & (b[offset + 2] << 16)) | (0xff000000 & (b[offset + 3] << 24)); } }