Length, maximum length and size

Describes the length of 8-bit and 16-bit descriptors.

A descriptor characterises the data it represents by the length of that data. The length of a descriptor is the number of data items it represents:

  • for 8 bit variant descriptors, the length is the number of single-bytes of data. When the descriptor represents non-Unicode strings, the length is the number of characters in the string.

  • for 16 bit variant descriptors, the length is the number of double-bytes of data. When the descriptor represents Unicode strings, the length is the number of characters in the string.

The length of a descriptor cannot be greater than 228.

The size of a descriptor is the number of bytes occupied by the data represented by that descriptor:

  • for the 8 bit variant descriptors, the size is the same as the length.

  • for the 16 bit variant descriptors, the size is twice the length.

The descriptors which allow their data to be modified are also characterised by a maximum length. This represents an upper limit on the length of data the descriptor can represent, i.e.the length of data represented by the descriptor can vary can vary from zero up to, and including, this maximum value.