Java Float Number Create toFloat(byte[] bytes, int index)

Here you can find the source of toFloat(byte[] bytes, int index)

Description

to Float

License

Apache License

Declaration

public static float toFloat(byte[] bytes, int index) 

Method Source Code

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

public class Main {
    public static float toFloat(byte[] bytes, int index) {
        return Float.intBitsToFloat(toInt(bytes, index));
    }// w ww  .  j av a 2 s .  c om

    public static int toInt(byte[] bytes, int index) {
        return (0xff & bytes[index]) | (0xff00 & (bytes[index + 1] << 8)) | (0xff0000 & (bytes[index + 2] << 16))
                | (0xff000000 & (bytes[index + 3] << 24));
    }
}

Related

  1. toFloat(byte[] byteArray)
  2. toFloat(byte[] bytes)
  3. toFloat(byte[] bytes)
  4. toFloat(byte[] bytes)
  5. toFloat(byte[] bytes)
  6. toFloat(byte[] bytes, int offset)
  7. toFloat(byte[] data)
  8. toFloat(byte[] data)
  9. toFloat(byte[] data, int offset)