encode
Encodes the given integer inp into a ByteArray using Varint encoding. The function supports encoding of Integers to Varint byte arrays, which are more efficient in representing smaller numbers using fewer bytes.
Return
The ByteArray representing inp in Varint format.
Parameters
inp
The integer to be encoded.