Java Byte Array Big Endian bytesHighFirstToFloat(byte[] bytes, int start)

Here you can find the source of bytesHighFirstToFloat(byte[] bytes, int start)

Description

bytes High First To Float

License

Apache License

Declaration

public static float bytesHighFirstToFloat(byte[] bytes, int start) 

Method Source Code

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

public class Main {
    public static float bytesHighFirstToFloat(byte[] bytes, int start) {
        int l = bytesHighFirstToInt(bytes, start);
        return Float.intBitsToFloat(l);
    }//from www  .j ava  2s .  c  om

    public static int bytesHighFirstToInt(byte[] bytes, int start) {
        int num = bytes[start + 3] & 0xFF;
        num |= ((bytes[start + 2] << 8) & 0xFF00);
        num |= ((bytes[start + 1] << 16) & 0xFF0000);
        num |= ((bytes[start] << 24) & 0xFF000000);
        return num;
    }
}

Related

  1. bytesBE2long(byte[] b, int off)
  2. BytesBEToFloat(final byte[] value)
  3. BytesBEToInt(final byte[] buf)
  4. bytesHighFirstToChar(byte[] bytes, int start)
  5. bytesHighFirstToInt(byte[] bytes, int start)