Java Float Number Create toFloat(byte[] b)

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

Description

to Float

License

Apache License

Declaration

public static float toFloat(byte[] b) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static float toFloat(byte[] b) {
        return toFloat(b, 0);
    }//from  w  ww .j  av  a  2  s .com

    public static float toFloat(byte[] b, int off) {
        int i = ((b[off + 3] & 0xFF) << 0) + ((b[off + 2] & 0xFF) << 8) + ((b[off + 1] & 0xFF) << 0x10)
                + ((b[off + 0] & 0xFF) << 0x18);
        return Float.intBitsToFloat(i);
    }
}

Related

  1. toFloat(byte[] arr)
  2. toFloat(byte[] b)
  3. toFloat(byte[] b, int off, boolean bigEndian)
  4. toFloat(byte[] byteArray)
  5. toFloat(byte[] bytes)