jamesmudd / jhdf

A pure Java HDF5 library
http://jhdf.io
MIT License
127 stars 35 forks source link

Allow for DataType.version = 0 #524

Open calum-maclean-ul opened 6 months ago

calum-maclean-ul commented 6 months ago

In DataType.readDataType(), version = 0 or version > 3 results in an exception. I have some files which use version = 0 in some places. These files are produced by a third party tool which I cannot control, and I want to be able to read them using jhdf. Would it be possible to consider some means to be able to load such files? Whether by removing the "version = 0" part, or by some other means.

jamesmudd commented 6 months ago

Thanks for raising this issue. Looking at the spec DataType version = 0 should not be in real files https://docs.hdfgroup.org/hdf5/v1_14/_f_m_t3.html#DatatypeMessage ? If you have a file that is exhibiting this maybe you could share it and I can have a look? If this is the behaviour I think I would want to special case this as it appear to be out of spec.

For versions >3 support is probably possible, again a test file would be useful to take a look at how much work is involved.

calum-maclean-ul commented 6 months ago

Sample.zip

I've attached the same file as for issue #523, so it contains both the version = 0 content and the Time datatype.