Implement variable-length integer type
Varint encodings use only the bytes that are needed to represent you integer value appropriately. A varint algorithm can represent the number 10 in only one byte while using 4 bytes to encode 800000000 (800 million).

It is widly used, in protobuf, in .Net binary reader/writer (known as 7-bit encoded int), etc.