ONC+ Developer's Guide

Variable-Length Array

Counted arrays enable variable-length arrays to be encoded as homogeneous elements. The element count n, an unsigned integer, is followed by each array element, starting with element 0 and progressing through element n-1.


The declaration for variable-length arrays follows this form.

type-name identifier<m>; 


type-name identifier<>;

The constant m specifies the maximum acceptable element count of an array. If m is not specified, it is assumed to be (2**32) - 1.

Counted Array Encoding

Text describes graphic.

Do not encode a length greater than the maximum described in the specification.