Hi,

I experiencing problems while reading dataset of string with hdf-java. I
can create a new 2 dimension dataset of string with dimension 3 x 2 and
length 100 both in code and HDFview. The h5dump utilities shows as
expected :

$ h5dump test.h5
HDF5 "test.h5" {
GROUP "/" {
   DATASET "test" {
      DATATYPE  H5T_STRING {
            STRSIZE 5;
            STRPAD H5T_STR_NULLPAD;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
      DATASPACE  SIMPLE { ( 3, 2 ) / ( 3, 2 ) }
      DATA {
      (0,0): "\000\000\000\000\000", "\000\000\000\000\000",
      (1,0): "\000\000\000\000\000", "\000\000\000\000\000",
      (2,0): "\000\000\000\000\000", "\000\000\000\000\000"
      }
   }
}
}

When I read this dataset in hdfview or in my code. The array of data is
not read correctly. 
In HDFview, the table shown is represented as a dataset with only one
column. However the metadata indicates 3x2.
In my code using hdf-java, I cannot read completely the dataset. The
read array as only 2 value.

H5ScalarDS dataset = ....
....
long[] dims = dataset.getDims();
The values of dims are [3, 2], which is correct.

Object data = dataset.read();
The Array.getLength(data) is 2, and I expect 6 to read my strings.

There is no problem for dataset with other types, with integer for
example.


I'm using hdf-java-2.7 and HDFView Version 2.7.


Thanks

Guillaume



_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to