Here you can find the source of bytesToFloat(byte[] bytes, int start)
public static float bytesToFloat(byte[] bytes, int start)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { private static final int FLOAT_BYTES = Float.SIZE / 8; private static final ByteBuffer FLOAT_BUFFER = ByteBuffer .allocate(FLOAT_BYTES);/* w ww. jav a 2s .co m*/ public static float bytesToFloat(byte[] bytes, int start) { FLOAT_BUFFER.position(0); FLOAT_BUFFER.put(bytes, start, FLOAT_BYTES); FLOAT_BUFFER.flip(); return FLOAT_BUFFER.getFloat(0); } }