Variable-length Quantity

A variable-length quantity (VLQ) is a universal code that uses an arbitrary number of binary octets (eight-bit bytes) to represent an arbitrarily large integer. It was defined for use in the standard MIDI file format to save additional space for a resource constrained system, and is also used in the later Extensible Music Format (XMF). A VLQ is essentially a base-128 representation of an unsigned integer with the addition of the eighth bit to mark continuation of bytes. See the example below.

Base-128 is also used in ASN.1 BER encoding to encode tag numbers, and it is used in the WAP environment, where it is called variable length unsigned integer or uintvar. The DWARF debugging format defines a variant called LEB128 (or ULEB128 for unsigned numbers), where the least significant group of 7 bits are encoded in the first byte and the most significant bits are in the last byte. Google's protocol buffers use a similar format to have compact representation of integer values, as does Oracle's Portable Object Format (POF).

Read more about Variable-length Quantity:  General Structure, Other Variants, Examples

Famous quotes containing the word quantity:

    The Great Society is a place where every child can find knowledge to enrich his mind and to enlarge his talents.... It is a place where the city of man serves not only the needs of the body and the demands of commerce but the desire for beauty and the hunger for community.... It is a place where men are more concerned with the quality of their goals than the quantity of their goods.
    Lyndon Baines Johnson (1908–1973)