Reading large data from HDF5 with C#

Hello,

I'm using HDF5 1.8.9 with the HDF5DotNet library. I'm trying to read a
large 1D array, but I have a problem with the returning data.

H5FileId myH5FileId = H5F.open(filename, H5F.OpenMode.ACC_RDONLY);
H5DataSetId myDataSetId = H5D.open(myH5FileId, "/data");
H5DataSpaceId myDataSetSpace = H5D.getSpace(myDataSetId);
// getting chunk size
H5PropertyListId myPropertyListId = H5D.getCreatePropertyList(myDataSetId);
long[] chunks = H5P.getChunk(myPropertyListId, 1);

dataArray = new Int16[chunks[0]];
H5S.selectHyperslab(myDataSetSpace, H5S.SelectOperator.SET, new Int64[]
{ chunks[0] * cunknumber }, chunks);
H5D.read(myDataSetId, new H5DataTypeId(H5T.H5Type.NATIVE_SHORT), new
H5DataSpaceId(H5S.H5SType.ALL), myDataSetSpace, new
H5PropertyListId(H5P.Template.DEFAULT), new H5Array<Int16>(dataArray));

H5P.close(myPropertyListId);
H5D.close(myDataSetId);
H5S.close(myDataSetSpace);
H5F.close(myH5FileId);

If cunknumber is 0 all works fine, but if cunknumber is 1 or greater the
dataArray must have the have the size of (chunks[0] * cunknumber) too.
But I only want to get one chunk.

Regards,
Maik Noczensky