public static int encodeNumeric(PositionedByteRange dst, long val, Order ord) {
    return encodeNumeric(dst, BigDecimal.valueOf(val), ord);
  }
Encode a numerical value using the variable-length encoding.
@param dst The destination to which encoded digits are written.
@param val The value to encode.
@param ord The {@link Order} to respect while encoding {@code val}.
@return the number of bytes written.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java