Compound type with member with variable length

I have the following problem:

  • I have a Java List of heterogeneous Objects that I want to write with HDF5. The objects on the list have different datatypes like floats, double, string variable length, arrays of floats, arrays variable length of string, usw…
    I wanted to write the list first in a compound structure, so every object in the list corresponds to a member on the compound. But I got problem with the objects with variable size or length. I could not build the size of the compound.

How can I solve my problem?