XDR represents variable-length arrays by first specifying an unsigned
integer (4 bytes) that gives the number of elements in the array, followed
by that many elements of the appropriate type. XDR encodes the components
of a structure in the order of their declaration in the structure. For
both arrays and structures, the size of each element/component is represented
in a multiple of 4 bytes. Smaller data types are padded out to
4 bytes with 0s. The exception to this “pad to 4 bytes” rule is made for
characters, which are encoded one per byte.