Often variable-length arrays of bytes are preferable to strings. Byte arrays differ from strings in the following three ways:
The length of the array, the byte count, is explicitly located in an unsigned integer.
The byte sequence is not terminated by a null character.
The external representation of the bytes is the same as their internal representation.
The primitive xdr_bytes() converts between the internal and external representations of byte arrays:
bool_t xdr_bytes(xdrs, bpp, lp, maxlength) XDR *xdrs; char **bpp; u_int *lp; u_int maxlength;
The usage of the first, second, and fourth parameters is identical to the first, second, and third parameters of xdr_string(). The length of the byte area is obtained by dereferencing lp when serializing; *lp is set to the byte length when deserializing.