public static float bytes_to_float ( byte [ ] bytes , int offset ) { try { int result = bytes [ 0 + offset ] & 0xff ; result <<= 8 ; result |= bytes [ 1 + offset ] & 0xff ; result <<= 8 ; result |= bytes [ 2 + offset ] & 0xff ; result <<= 8 ; result |= bytes [ 3 + offset ] & 0xff ; return Float . intBitsToFloat ( result ) ; } catch ( IndexOutOfBoundsException x ) { throw new PickleException ( "decoding float: too few bytes" ) ; } }
Convert a big endian 4 - byte to a float .