public static int encodeFloat32(PositionedByteRange dst, float val, Order ord) {
    final int offset = dst.getOffset(), start = dst.getPosition();
    int i = Float.floatToIntBits(val);
    i ^= ((i >> (Integer.SIZE - 1)) | Integer.MIN_VALUE);
    dst.put(FIXED_FLOAT32).put((byte) (i >> 24)).put((byte) (i >> 16)).put((byte) (i >> 8))
      .put((byte) i);
    ord.apply(dst.getBytes(), offset + start, 5);
    return 5;
  }
Encode a 32-bit floating point value using the fixed-length encoding. Encoding format is
described at length in {@link #encodeFloat64(PositionedByteRange, double, Order)}.
@return the number of bytes written.
@see #decodeFloat32(PositionedByteRange)
@see #encodeFloat64(PositionedByteRange, double, Order)
hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java