Android Byte Array to Float Convert toFloat(byte[] b, int pos)

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

Description

to Float

Declaration

public static float toFloat(byte[] b, int pos) 

Method Source Code

//package com.java2s;

public class Main {

    public static float toFloat(byte[] b, int pos) {
        int accum = 0;
        for (int i = 0; i < 4; i++) {
            accum |= (b[i + pos] & 0xff) << i * 8;
        }/*from  w  ww. j av  a  2s.c  om*/
        return Float.intBitsToFloat(accum);
    }
}

Related

  1. getFloat(byte[] buf, boolean bigEndian)
  2. getFloat(byte[] bytes)
  3. getFloat(int offset, byte[] fromBytes)
  4. getFloats(float[] toFloats, byte[] fromBytes)
  5. getFloats(float[] toFloats, int offset, byte[] fromBytes)
  6. toFloatEx(byte[] b, int pos)