In HDF5 Java, what does error does MajorErrorNumber 15401984 denote? I am
getting this error when I am trying to create a dataset of an opaque
datatype under a group.
public static void createFile(Message message)throws Exception{
try{
// retrieve an instance of H5File
FileFormat fileFormat =
FileFormat.getFileFormat(FileFormat.FILE_TYPE_HDF5);
if (fileFormat == null)
{
System.err.println("Cannot find HDF5 FileFormat.");
return;
}
// create a new file with a given file name.
H5File testFile = (H5File)fileFormat.create(fname);
if (testFile == null)
{
System.err.println("Failed to create file:"+fname);
return;
}
// open the file and retrieve the root group
testFile.open();
Group root =
(Group)((javax.swing.tree.DefaultMutableTreeNode)testFile.getRootNode()).getUserObject();
Group g1 = testFile.createGroup("byte arrays", root);
byte[] b =serializer.serialize(message);
int len=b.length;`enter code here`
byte[] dset_data = new byte[len+1];
// Initialize data.
int indx=0;
for (int jndx = 0; jndx < len ; jndx++)
dset_data[jndx] = b[jndx];
dset_data[len] = (byte)(indx) ;
// create byte array of opaque dataset
Datatype dtype = new H5Datatype(
Datatype.CLASS_OPAQUE, len, -1, -1);
testFile.createScalarDS
("byte array", g1, dtype, dims1D, null, null, 0, dset_data);
// close file resource
testFile.close();
}
} catch(HDF5LibraryException e){
System.out.println(e.getMajorErrorNumber());
System.out.println(e.getMinorErrorNumber());
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}
The line of error shown is
testFile.createScalarDS ("byte array", g1, dtype, dims1D, null, null, 0,
dset_data);
Why is it unable to create a Scalar Dataset of an opaque datatype under a
group?
···
--
View this message in context: http://hdf-forum.184993.n3.nabble.com/Major-Error-Number-15401984-tp3824647p3824647.html
Sent from the hdf-forum mailing list archive at Nabble.com.