Read HDF5 file data from a buffer in RAM

I’m looking for a way to be able to take a buffer I have in memory, and have HDF5 interpret it as a (read only) HDF5 file, so I can extract the data to be send elsewhere. I would prefer to avoid having to write this data to disk if possible, since the data is small and the devices we need to run on make file IO more difficult than your usual OS.

It looks like this used to be relatively easy to do (HDF5: HDF5 Virtual File Layer shows a pretty straight forward route to adding a VFD driver), but how to do this nowadays is not as clear.

I’ve seen a few posts about creating new HDF5 datasets in memory and then filling them, but not going the other way. I know it’s a bit of a strange use case, but I can think of several situations where it would be useful (including being extremely useful for testing HDF5 itself).

How about HDF5 File Image Operations ? See Section 4. Examples. OK? G.

1 Like

Thank you @gheber, that looks like exactly what I am after (and apparently doesn’t use any of the words I was searching for, which explains why I never found it!). I’m quite new to HDF5 so I shouldn’t be surprised I had the wrong vocabulary. I’ll give that a go and see if it works out for us.

1 Like