2.2.1.3 Marshaling Referenced Data Types

This section describes an array of N data type instances, each referencing by offset another data type instance.

In this case, the custom-marshaled data contains N Fixed_Portion blocks (one for each main data type instance), followed by M additional Fixed_Portion blocks (one for each referenced data type instances), followed by the Variable_Data block containing data referenced by offset from all Fixed_Portion blocks. The order in which the referenced data type instances Fixed_Portion block arrays are marshaled is the order in which the corresponding offset fields are defined in the main data type instance.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Fixed_Portion_1 (variable)

...

Fixed_Portion_N (variable)

...

Referenced_Fixed_Portion_1 (variable)

...

Referenced_Fixed_Portion_M (variable)

...

Variable_Data (variable)

...

Fixed_Portion_1 (variable): The Fixed_Portion block of the first data type instance in the array.

Fixed_Portion_N (variable): The Fixed_Portion block of the last data type instance in the array.

Referenced_Fixed_Portion_1 (variable): The Fixed_Portion block of the first referenced data type instance in the array.

Referenced_Fixed_Portion_M (variable): The Fixed_Portion block of the last referenced data type instance in the array.

Variable_Data (variable): A sequence of zero or more optional fields (or variable-length fields). The data in this field is referenced by offset from the Fixed_Portion blocks and the Referenced_Fixed_Portion blocks.