HDF5 Java variable length compound data type


#1

Hello everyone,

I have been reading all the documentation about writing HDF5 files in Java. I need to write a variable length dataset of a compound data type. I know how to create the compound data type but it seems that variable length datasets are only supported for strings in Java. In HDFView, the dataset would look something like this.

[Row 1] {x,y,z,r} {x,y,z,r} {x,y,z,r}
[Row 2] {x,y,z,r} {x,y,z,r} {x,y,z,r}
.
.
.
where the compound data type is {x,y,z,r}

It seems that using H5Tvlen_create will not help because it is incompatible with writing the buffer required for compound data types in Java.

The current file with this dataset was generated using the Python API. Am I missing something or what would be the best solution for this? I would thank any example about how to create this type of data set.

Kind regards


#2

Is the dataset variable length or does it have an unlimited dimension dataspace? (It looks like there are the same number of elements in each row.) Here is a Java example that shows how to create an unlimited dimension dataset with a compound datatype, in case that might be what you need:

unlimcmp.java (15.5 KB)

If that does not help, can you send your file to the HDF Helpdesk (help@hdfgroup.org), or at least the output of “h5dump -H”?

Thanks!
-Barbara