public static int encodeInt32(PositionedByteRange dst, int val, Order ord) {
    final int offset = dst.getOffset(), start = dst.getPosition();
    dst.put(FIXED_INT32).put((byte) ((val >> 24) ^ 0x80)).put((byte) (val >> 16))
      .put((byte) (val >> 8)).put((byte) val);
    ord.apply(dst.getBytes(), offset + start, 5);
    return 5;
  }
Encode an {@code int32} value using the fixed-length encoding.
@return the number of bytes written.
@see #encodeInt64(PositionedByteRange, long, Order)
@see #decodeInt32(PositionedByteRange)
hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java