Hi,

I need to write scientific data in a 16 bits unsigned int multi dimensional
array.
My data in java is in memory in a 32 bit signed int multi dimensional array.

The in memory array and the dataset have the same dimensions.

This how I have create my hdf5 dataset:
Datatype dtype = testFile.createDatatype(Datatype.CLASS_INTEGER, 2,
Datatype.NATIVE, Datatype.SIGN_NONE);

Dataset dataset = testFile.createScalarDS("radiance", g1, dtype, dims2D,
null, null, 0, null);

I get a conversion exception when I try to write the full array with
dataset.write()

java.lang.ClassCastException: [[I cannot be cast to [I
        at ncsa.hdf.object.Dataset.convertToUnsignedC(Dataset.java:1110)
        at ncsa.hdf.object.h5.H5ScalarDS.write(H5ScalarDS.java:905)
        at eumetsat.sandbox.Sandbox.create_dset(Sandbox.java:234)
        at eumetsat.sandbox.Sandbox.main(Sandbox.java:299)

Could you please let me know what I am doing wrong or point me out to a
piece of code example doing the same thing.

Many thanks
Guillaume



                

--
View this message in context: 
http://hdf-forum.184993.n3.nabble.com/writing-16-bits-unsigned-int-with-java-hdf-tp4025219.html
Sent from the hdf-forum mailing list archive at Nabble.com.

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

Reply via email to