Java Byte Array to Float byteArrayToFloat(byte[] b)

Here you can find the source of byteArrayToFloat(byte[] b)

Description

byte Array To Float

License

Open Source License

Declaration

public static float byteArrayToFloat(byte[] b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static float byteArrayToFloat(byte[] b) {
        int l = byteArrayToInt(b);
        return Float.intBitsToFloat(l);
    }/*from   w  w w . j a  v a 2 s.c om*/

    public static int byteArrayToInt(byte[] b) {
        return (b[0] << 24) + ((b[1] & 0xFF) << 16) + ((b[2] & 0xFF) << 8) + (b[3] & 0xFF);
    }
}

Related

  1. arr2float(byte[] b)
  2. byteArrayToFloat(byte value[])
  3. byteArrayToFloat(byte[] array)
  4. byteArrayToFloat(byte[] byteArray)
  5. byteArrayToFloat(byte[] byteArray)
  6. byteArrayToFloat(byte[] bytes)
  7. byteArrayToFloat(byte[] bytes, int size, int fpBits)