summaryrefslogtreecommitdiffstats
path: root/java/src/hdf
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-06-29 16:17:28 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-06-29 16:17:28 (GMT)
commitb6fcbf4bb0f693fd6a0517f0ff3f74d52b329d1e (patch)
tree4a726f9c7af3d4460a79444ccc4bdabe6698b264 /java/src/hdf
parent4095b9260d5c24f65b1e57a1617f561415e8f05f (diff)
parentb1f5c9e9d63e16d67089f08ef2becc5119592a76 (diff)
downloadhdf5-b6fcbf4bb0f693fd6a0517f0ff3f74d52b329d1e.zip
hdf5-b6fcbf4bb0f693fd6a0517f0ff3f74d52b329d1e.tar.gz
hdf5-b6fcbf4bb0f693fd6a0517f0ff3f74d52b329d1e.tar.bz2
Merge pull request #1123 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit 'b1f5c9e9d63e16d67089f08ef2becc5119592a76': Fix ptr arith Correct function call Remove writeVL option Region reference in compounds need class check Correct cast formatting Correct var name Need to cast from void ptr Update Java util lib, Refactor H5D write VL to match read
Diffstat (limited to 'java/src/hdf')
-rw-r--r--java/src/hdf/hdf5lib/H5.java21
1 files changed, 7 insertions, 14 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index f826fbc..f58623e 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -1746,20 +1746,15 @@ public class H5 implements java.io.Serializable {
status = H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
(double[]) obj, isCriticalPinning);
}
- else if (H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) {
+ else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) && (is1D && (dataClass.getComponentType() == String.class))) || H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) {
log.trace("H5Dread_reg_ref");
status = H5Dread_reg_ref(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
(String[]) obj);
}
else if (is1D && (dataClass.getComponentType() == String.class)) {
log.trace("H5Dread_string type");
- if (H5.H5Tis_variable_str(mem_type_id)) {
- status = H5Dread_VLStrings(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (Object[]) obj);
- }
- else {
- status = H5Dread_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
+ status = H5Dread_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
(String[]) obj);
- }
}
else {
// Create a data buffer to hold the data into a Java Array
@@ -1979,7 +1974,7 @@ public class H5 implements java.io.Serializable {
Class dataClass = obj.getClass();
if (!dataClass.isArray()) {
- throw (new HDF5JavaException("H5Dread: data is not an array"));
+ throw (new HDF5JavaException("H5Dwrite: data is not an array"));
}
String cname = dataClass.getName();
@@ -2012,13 +2007,8 @@ public class H5 implements java.io.Serializable {
}
else if (is1D && (dataClass.getComponentType() == String.class)) {
log.trace("H5Dwrite_string type");
- if (H5.H5Tis_variable_str(mem_type_id)) {
- status = H5Dwrite_VLStrings(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (Object[]) obj);
- }
- else {
- status = H5Dwrite_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
+ status = H5Dwrite_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
(String[]) obj);
- }
}
else {
HDFArray theArray = new HDFArray(obj);
@@ -2084,6 +2074,9 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Dwrite_string(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException;
+ public synchronized static native int H5DwriteVL(long dataset_id, long mem_type_id, long mem_space_id,
+ long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException;
+
/**
* H5Dwrite_VLStrings writes a (partial) variable length String dataset, specified by its identifier dataset_id, from
* the application memory buffer buf into the file.