Try this:
===============
// open the file and the dataset with refs
file.open();
ds = (H5ScalarDS)file.get(dname);
long[] refs = (long[])ds.getData();
// use low level API function, H5.H5Rget_name
String[] name = {""};;
for (int i=0; i<refs.length; i++) {
H5.H5Rget_name(file.getFID(), HDF5Constants.H5R_OBJECT,
HDFNativeData.longToByte(refs[i]), name, 32);
System.out.println(name[0]);
}
// if file.open() was called, search objects in memory by high
level function, findObject()
long[] oid = new long[1];
for (int i=0; i<refs.length; i++) {
oid[0] = refs[i];
HObject obj = FileFormat.findObject(file, oid);
System.out.println(obj.getFullName());
}
==============
On 3/28/2011 6:07 AM, Konrad Hinsen wrote:
Hi everyone,
when I read an array of datatype "object reference" using the high-level Java
interface, I get an array of long integers. How can I get the corresponding objects?
Thanks in advance,
Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Centre de Biophysique Moléculaire, CNRS Orléans
Synchrotron Soleil - Division Expériences
Saint Aubin - BP 48
91192 Gif sur Yvette Cedex, France
Tel. +33-1 69 35 97 15
E-Mail: research AT khinsen DOT fastmail DOT net
---------------------------------------------------------------------
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org