Android Byte Array to Float Convert getFloat(byte[] b, int index)

Here you can find the source of getFloat(byte[] b, int index)

Description

get Float

Declaration

public static float getFloat(byte[] b, int index) 

Method Source Code

//package com.java2s;

public class Main {

    public static float getFloat(byte[] b, int index) {
        int l;/*  w w  w  .j  a v  a 2  s. com*/
        l = b[index + 0];
        l &= 0xff;
        l |= ((long) b[index + 1] << 8);
        l &= 0xffff;
        l |= ((long) b[index + 2] << 16);
        l &= 0xffffff;
        l |= ((long) b[index + 3] << 24);
        return Float.intBitsToFloat(l);
    }
}

Related

  1. bytesLE2float(byte[] b, int off)
  2. bytesLE2floats(byte[] b)
  3. bytesLE2floats2doubles(byte[] b)
  4. bytesToFloat(byte[] bytes)
  5. bytesToFloat(byte[] bytes, int start)
  6. getFloat(byte[] buf, boolean bigEndian)
  7. getFloat(byte[] bytes)
  8. getFloat(int offset, byte[] fromBytes)
  9. getFloats(float[] toFloats, byte[] fromBytes)