double val = 18.5;
ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
DataOutputStream datastream = new DataOutputStream(bytestream);
datastream.writeDouble(val);
datastream.flush();
datastream.close();
bytestream.close();
byte[] bytes = bytestream.toByteArray();
for (int j = 0; j < bytes.length; j++) {
write_data[indx] = bytes[j];
indx++;
H5.H5Dwrite(dataset_id, memtype_id, HDF5Constants.H5S_ALL,
HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT,write_data);
After the data is created and written into the file, when the user tries to open and read the data in HDF view, instead of 18.9, it shows 1.3456789345E45
Comments
Post a Comment