1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group.                                               *
3  * Copyright by the Board of Trustees of the University of Illinois.         *
4  * All rights reserved.                                                      *
5  *                                                                           *
6  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
7  * terms governing use, modification, and redistribution, is contained in    *
8  * the COPYING file, which can be found at the root of the source code       *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.  *
10  * If you do not have access to either file, you may request a copy from     *
11  * help@hdfgroup.org.                                                        *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 
15 package hdf.hdf5lib;
16 
17 import java.io.File;
18 import java.nio.ByteBuffer;
19 import java.util.Collection;
20 import java.util.LinkedHashSet;
21 import hdf.hdf5lib.callbacks.H5A_iterate_cb;
22 import hdf.hdf5lib.callbacks.H5A_iterate_t;
23 import hdf.hdf5lib.callbacks.H5D_iterate_cb;
24 import hdf.hdf5lib.callbacks.H5D_iterate_t;
25 import hdf.hdf5lib.callbacks.H5E_walk_cb;
26 import hdf.hdf5lib.callbacks.H5E_walk_t;
27 import hdf.hdf5lib.callbacks.H5L_iterate_cb;
28 import hdf.hdf5lib.callbacks.H5L_iterate_t;
29 import hdf.hdf5lib.callbacks.H5O_iterate_cb;
30 import hdf.hdf5lib.callbacks.H5O_iterate_t;
31 import hdf.hdf5lib.callbacks.H5P_cls_close_func_cb;
32 import hdf.hdf5lib.callbacks.H5P_cls_close_func_t;
33 import hdf.hdf5lib.callbacks.H5P_cls_copy_func_cb;
34 import hdf.hdf5lib.callbacks.H5P_cls_copy_func_t;
35 import hdf.hdf5lib.callbacks.H5P_cls_create_func_cb;
36 import hdf.hdf5lib.callbacks.H5P_cls_create_func_t;
37 import hdf.hdf5lib.callbacks.H5P_prp_set_func_cb;
38 import hdf.hdf5lib.callbacks.H5P_prp_get_func_cb;
39 import hdf.hdf5lib.callbacks.H5P_prp_delete_func_cb;
40 import hdf.hdf5lib.callbacks.H5P_prp_copy_func_cb;
41 import hdf.hdf5lib.callbacks.H5P_prp_compare_func_cb;
42 import hdf.hdf5lib.callbacks.H5P_prp_close_func_cb;
43 import hdf.hdf5lib.callbacks.H5P_prp_create_func_cb;
44 import hdf.hdf5lib.callbacks.H5P_iterate_cb;
45 import hdf.hdf5lib.callbacks.H5P_iterate_t;
46 import hdf.hdf5lib.exceptions.HDF5Exception;
47 import hdf.hdf5lib.exceptions.HDF5JavaException;
48 import hdf.hdf5lib.exceptions.HDF5LibraryException;
49 import hdf.hdf5lib.structs.H5AC_cache_config_t;
50 import hdf.hdf5lib.structs.H5A_info_t;
51 import hdf.hdf5lib.structs.H5E_error2_t;
52 import hdf.hdf5lib.structs.H5F_info2_t;
53 import hdf.hdf5lib.structs.H5FD_hdfs_fapl_t;
54 import hdf.hdf5lib.structs.H5FD_ros3_fapl_t;
55 import hdf.hdf5lib.structs.H5G_info_t;
56 import hdf.hdf5lib.structs.H5L_info_t;
57 import hdf.hdf5lib.structs.H5O_info_t;
58 
59 /**
60  * This class is the Java interface for the HDF5 library.
61  * <p>
62  * This code is the called by Java programs to access the entry points of the HDF5 library. Each routine wraps a single
63  * HDF5 entry point, generally with the arguments and return codes analogous to the C interface.
64  * <p>
65  * For details of the HDF5 library, see the HDF5 Documentation at: <a
66  * href="http://hdfgroup.org/HDF5/">http://hdfgroup.org/HDF5/</a>
67  * <hr>
68  * <p>
69  * <b>Mapping of arguments for Java</b>
70  *
71  * <p>
72  * In general, arguments to the HDF Java API are straightforward translations from the 'C' API described in the HDF
73  * Reference Manual.
74  *
75  * <table border=1>
76  * <caption><b>HDF-5 C types to Java types</b> </caption>
77  * <tr>
78  * <td><b>HDF-5</b></td>
79  * <td><b>Java</b></td>
80  * </tr>
81  * <tr>
82  * <td>H5T_NATIVE_INT</td>
83  * <td>int, Integer</td>
84  * </tr>
85  * <tr>
86  * <td>H5T_NATIVE_SHORT</td>
87  * <td>short, Short</td>
88  * </tr>
89  * <tr>
90  * <td>H5T_NATIVE_FLOAT</td>
91  * <td>float, Float</td>
92  * </tr>
93  * <tr>
94  * <td>H5T_NATIVE_DOUBLE</td>
95  * <td>double, Double</td>
96  * </tr>
97  * <tr>
98  * <td>H5T_NATIVE_CHAR</td>
99  * <td>byte, Byte</td>
100  * </tr>
101  * <tr>
102  * <td>H5T_C_S1</td>
103  * <td>java.lang.String</td>
104  * </tr>
105  * <tr>
106  * <td>void * <BR>
107  * (i.e., pointer to `Any')</td>
108  * <td>Special -- see HDFArray</td>
109  * </tr>
110  * </table>
111  * <b>General Rules for Passing Arguments and Results</b>
112  * <p>
113  * In general, arguments passed <b>IN</b> to Java are the analogous basic types, as above. The exception is for arrays,
114  * which are discussed below.
115  * <p>
116  * The <i>return value</i> of Java methods is also the analogous type, as above. A major exception to that rule is that
117  * all HDF functions that return SUCCEED/FAIL are declared <i>boolean</i> in the Java version, rather than <i>int</i> as
118  * in the C. Functions that return a value or else FAIL are declared the equivalent to the C function. However, in most
119  * cases the Java method will raise an exception instead of returning an error code. See <a href="#ERRORS">Errors and
120  * Exceptions</a> below.
121  * <p>
122  * Java does not support pass by reference of arguments, so arguments that are returned through <b>OUT</b> parameters
123  * must be wrapped in an object or array. The Java API for HDF consistently wraps arguments in arrays.
124  * <p>
125  * For instance, a function that returns two integers is declared:
126  *
127  * <pre>
128  *       h_err_t HDF5dummy( int *a1, int *a2)
129  * </pre>
130  *
131  * For the Java interface, this would be declared:
132  *
133  * <pre>
134  * public synchronized static native int HDF5dummy(int args[]);
135  * </pre>
136  *
137  * where <i>a1</i> is <i>args[0]</i> and <i>a2</i> is <i>args[1]</i>, and would be invoked:
138  *
139  * <pre>
140  * H5.HDF5dummy(a);
141  * </pre>
142  *
143  * <p>
144  * All the routines where this convention is used will have specific documentation of the details, given below.
145  * <p>
146  * <b>Arrays</b>
147  * <p>
148  * HDF5 needs to read and write multi-dimensional arrays of any number type (and records). The HDF5 API describes the
149  * layout of the source and destination, and the data for the array passed as a block of bytes, for instance,
150  *
151  * <pre>
152  *      herr_t H5Dread(long fid, long filetype, long memtype, long memspace,
153  *      void * data);
154  * </pre>
155  *
156  * <p>
157  * where ``void *'' means that the data may be any valid numeric type, and is a contiguous block of bytes that is the
158  * data for a multi-dimensional array. The other parameters describe the dimensions, rank, and datatype of the array on
159  * disk (source) and in memory (destination).
160  * <p>
161  * For Java, this ``ANY'' is a problem, as the type of data must always be declared. Furthermore, multidimensional
162  * arrays are definitely <i>not</i> layed out contiguously in memory. It would be infeasible to declare a separate
163  * routine for every combination of number type and dimensionality. For that reason, the <a
164  * href="./hdf.hdf5lib.HDFArray.html"><b>HDFArray</b></a> class is used to discover the type, shape, and size of the
165  * data array at run time, and to convert to and from a contiguous array of bytes in synchronized static native C order.
166  * <p>
167  * The upshot is that any Java array of numbers (either primitive or sub-classes of type <b>Number</b>) can be passed as
168  * an ``Object'', and the Java API will translate to and from the appropriate packed array of bytes needed by the C
169  * library. So the function above would be declared:
170  *
171  * <pre>
172  * public synchronized static native int H5Dread(long fid, long filetype, long memtype, long memspace, Object data);
173  * </pre>
174  *            OPEN_IDS.addElement(id);
175 
176  * and the parameter <i>data</i> can be any multi-dimensional array of numbers, such as float[][], or int[][][], or
177  * Double[][].
178  * <p>
179  * <b>HDF-5 Constants</b>
180  * <p>
181  * The HDF-5 API defines a set of constants and enumerated values. Most of these values are available to Java programs
182  * via the class <a href="./hdf.hdf5lib.HDF5Constants.html"> <b>HDF5Constants</b></a>. For example, the parameters for
183  * the h5open() call include two numeric values, <b><i>HDFConstants.H5F_ACC_RDWR</i></b> and
184  * <b><i>HDF5Constants.H5P_DEFAULT</i></b>. As would be expected, these numbers correspond to the C constants
185  * <b><i>H5F_ACC_RDWR</i></b> and <b><i>H5P_DEFAULT</i></b>.
186  * <p>
187  * The HDF-5 API defines a set of values that describe number types and sizes, such as "H5T_NATIVE_INT" and "hsize_t".
188  * These values are determined at run time by the HDF-5 C library. To support these parameters, the Java class <a
189  * href="./hdf.hdf5lib.HDF5CDataTypes.html"> <b>HDF5CDataTypes</b></a> looks up the values when initiated. The values
190  * can be accessed as public variables of the Java class, such as:
191  *
192  * <pre>
193  * long data_type = HDF5CDataTypes.JH5T_NATIVE_INT;
194  * </pre>
195  *
196  * The Java application uses both types of constants the same way, the only difference is that the
197  * <b><i>HDF5CDataTypes</i></b> may have different values on different platforms.
198  * <p>
199  * <b>Error handling and Exceptions</b>
200  * <p>
201  * The HDF5 error API (H5E) manages the behavior of the error stack in the HDF-5 library. This API is omitted from the
202  * JHI5. Errors are converted into Java exceptions. This is totally different from the C interface, but is very natural
203  * for Java programming.
204  * <p>
205  * The exceptions of the JHI5 are organized as sub-classes of the class <a
206  * href="./hdf.hdf5lib.exceptions.HDF5Exception.html"> <b>HDF5Exception</b></a>. There are two subclasses of
207  * <b>HDF5Exception</b>, <a href="./hdf.hdf5lib.exceptions.HDF5LibraryException.html"> <b>HDF5LibraryException</b></a>
208  * and <a href="./hdf.hdf5lib.exceptions.HDF5JavaException.html"> <b>HDF5JavaException</b></a>. The sub-classes of the
209  * former represent errors from the HDF-5 C library, while sub-classes of the latter represent errors in the JHI5
210  * wrapper and support code.
211  * <p>
212  * The super-class <b><i>HDF5LibraryException</i></b> implements the method '<b><i>printStackTrace()</i></b>', which
213  * prints out the HDF-5 error stack, as described in the HDF-5 C API <i><b>H5Eprint()</b>.</i> This may be used by Java
214  * exception handlers to print out the HDF-5 error stack.
215  * <hr>
216  *
217  * @version HDF5 1.10.6 <BR>
218  *          <b>See also: <a href ="./hdf.hdf5lib.HDFArray.html"> hdf.hdf5lib.HDFArray</a> </b><BR>
219  *          <a href ="./hdf.hdf5lib.HDF5Constants.html"> hdf.hdf5lib.HDF5Constants</a><BR>
220  *          <a href ="./hdf.hdf5lib.HDF5CDataTypes.html"> hdf.hdf5lib.HDF5CDataTypes</a><BR>
221  *          <a href ="./hdf.hdf5lib.HDF5Exception.html"> hdf.hdf5lib.HDF5Exception</a><BR>
222  *          <a href="http://hdfgroup.org/HDF5/"> http://hdfgroup.org/HDF5"</a>
223  **/
224 public class H5 implements java.io.Serializable {
225     /**
226      *
227      */
228     private static final long serialVersionUID = 6129888282117053288L;
229 
230     private final static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(H5.class);
231 
232     /**
233      * The version number of the HDF5 library:
234      * LIB_VERSION[0]: The major version of the library.
235      * LIB_VERSION[1]: The minor version of the library.
236      * LIB_VERSION[2]: The release number of the library.
237      *
238      * Make sure to update the versions number when a different library is used.
239      */
240     public final static int LIB_VERSION[] = { 1, 10, 6 };
241 
242     public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib";
243 
244     // add system property to load library by name from library path, via
245     // System.loadLibrary()
246     public final static String H5_LIBRARY_NAME_PROPERTY_KEY = "hdf.hdf5lib.H5.loadLibraryName";
247     private static String s_libraryName;
248     private static boolean isLibraryLoaded = false;
249 
250     private final static boolean IS_CRITICAL_PINNING = true;
251     // change from Vector to LinkedHashSet - jp 6-Oct-2014
252     private final static LinkedHashSet<Long> OPEN_IDS = new LinkedHashSet<Long>();
253 
254     static {
loadH5Lib()255         loadH5Lib();
256     }
257 
loadH5Lib()258     public static void loadH5Lib() {
259         // Make sure that the library is loaded only once
260         if (isLibraryLoaded)
261             return;
262 
263         // first try loading library by name from user supplied library path
264         s_libraryName = System.getProperty(H5_LIBRARY_NAME_PROPERTY_KEY, null);
265         String mappedName = null;
266         if ((s_libraryName != null) && (s_libraryName.length() > 0)) {
267             try {
268                 mappedName = System.mapLibraryName(s_libraryName);
269                 System.loadLibrary(s_libraryName);
270                 isLibraryLoaded = true;
271             }
272             catch (Throwable err) {
273                 err.printStackTrace();
274                 isLibraryLoaded = false;
275             }
276             finally {
277                 log.info("HDF5 library: " + s_libraryName);
278                 log.debug(" resolved to: " + mappedName + "; ");
279                 log.info((isLibraryLoaded ? "" : " NOT") + " successfully loaded from system property");
280             }
281         }
282 
283         if (!isLibraryLoaded) {
284             // else try loading library via full path
285             String filename = System.getProperty(H5PATH_PROPERTY_KEY, null);
286             if ((filename != null) && (filename.length() > 0)) {
287                 File h5dll = new File(filename);
288                 if (h5dll.exists() && h5dll.canRead() && h5dll.isFile()) {
289                     try {
290                         System.load(filename);
291                         isLibraryLoaded = true;
292                     }
293                     catch (Throwable err) {
294                         err.printStackTrace();
295                         isLibraryLoaded = false;
296                     }
297                     finally {
298                         log.info("HDF5 library: ");
299                         log.debug(filename);
300                         log.info((isLibraryLoaded ? "" : " NOT") + " successfully loaded.");
301                     }
302                 }
303                 else {
304                     isLibraryLoaded = false;
305                     throw (new UnsatisfiedLinkError("Invalid HDF5 library, " + filename));
306                 }
307             }
308         }
309 
310         // else load standard library
311         if (!isLibraryLoaded) {
312             try {
313                 s_libraryName = "hdf5_java";
314                 mappedName = System.mapLibraryName(s_libraryName);
315                 System.loadLibrary("hdf5_java");
316                 isLibraryLoaded = true;
317             }
318             catch (Throwable err) {
319                 err.printStackTrace();
320                 isLibraryLoaded = false;
321             }
322             finally {
323                 log.info("HDF5 library: " + s_libraryName);
324                 log.debug(" resolved to: " + mappedName + "; ");
325                 log.info((isLibraryLoaded ? "" : " NOT") + " successfully loaded from java.library.path");
326             }
327         }
328 
329         /* Important! Exit quietly */
330         try {
331             H5.H5dont_atexit();
332         }
333         catch (HDF5LibraryException e) {
334             System.exit(1);
335         }
336 
337         /* Important! Disable error output to C stdout */
338         if (!log.isDebugEnabled())
339             H5.H5error_off();
340 
341         /*
342          * Optional: confirm the version This will crash immediately if not the specified version.
343          */
344         Integer majnum = Integer.getInteger("hdf.hdf5lib.H5.hdf5maj", null);
345         Integer minnum = Integer.getInteger("hdf.hdf5lib.H5.hdf5min", null);
346         Integer relnum = Integer.getInteger("hdf.hdf5lib.H5.hdf5rel", null);
347         if ((majnum != null) && (minnum != null) && (relnum != null)) {
348             H5.H5check_version(majnum.intValue(), minnum.intValue(), relnum.intValue());
349         }
350     }
351 
352     // ////////////////////////////////////////////////////////////
353     // //
354     // H5: General Library Functions //
355     // //
356     // ////////////////////////////////////////////////////////////
357 
358     /**
359      * Get number of open IDs.
360      *
361      * @return Returns a count of open IDs
362      */
getOpenIDCount()363     public final static int getOpenIDCount() {
364         return OPEN_IDS.size();
365     }
366 
367     /**
368      * Get the open IDs
369      *
370      * @return Returns a collection of open IDs
371      */
getOpenIDs()372     public final static Collection<Long> getOpenIDs() {
373         return OPEN_IDS;
374     }
375 
376     /**
377      * H5check_version verifies that the arguments match the version numbers compiled into the library.
378      *
379      * @param majnum
380      *            The major version of the library.
381      * @param minnum
382      *            The minor version of the library.
383      * @param relnum
384      *            The release number of the library.
385      * @return a non-negative value if successful. Upon failure (when the versions do not match), this function causes
386      *         the application to abort (i.e., crash)
387      *
388      *         See C API function: herr_t H5check_version()
389      **/
H5check_version(int majnum, int minnum, int relnum)390     public synchronized static native int H5check_version(int majnum, int minnum, int relnum);
391 
392     /**
393      * H5close flushes all data to disk, closes all file identifiers, and cleans up all memory used by the library.
394      *
395      * @return a non-negative value if successful
396      *
397      * @exception HDF5LibraryException
398      *                - Error from the HDF-5 Library.
399      **/
H5close()400     public synchronized static native int H5close() throws HDF5LibraryException;
401 
402     /**
403      * H5open initialize the library.
404      *
405      * @return a non-negative value if successful
406      *
407      * @exception HDF5LibraryException
408      *                - Error from the HDF-5 Library.
409      **/
H5open()410     public synchronized static native int H5open() throws HDF5LibraryException;
411 
412     /**
413      * H5dont_atexit indicates to the library that an atexit() cleanup routine should not be installed. In order to be
414      * effective, this routine must be called before any other HDF function calls, and must be called each time the
415      * library is loaded/linked into the application (the first time and after it's been unloaded).
416      * <P>
417      * This is called by the static initializer, so this should never need to be explicitly called by a Java program.
418      *
419      * @return a non-negative value if successful
420      *
421      * @exception HDF5LibraryException
422      *                - Error from the HDF-5 Library.
423      **/
H5dont_atexit()424     private synchronized static native int H5dont_atexit() throws HDF5LibraryException;
425 
426     /**
427      * Turn off error handling. By default, the C library prints the error stack of the HDF-5 C library on stdout. This
428      * behavior may be disabled by calling H5error_off().
429      *
430      * @return a non-negative value if successful
431      */
H5error_off()432     public synchronized static native int H5error_off();
433 
434     /**
435      * Turn on error handling. By default, the C library prints the error stack of the HDF-5 C library on stdout. This
436      * behavior may be reenabled by calling H5error_on().
437      */
H5error_on()438     public synchronized static native void H5error_on();
439 
440     /**
441      * H5garbage_collect collects on all free-lists of all types.
442      *
443      * @return a non-negative value if successful
444      *
445      * @exception HDF5LibraryException
446      *                - Error from the HDF-5 Library.
447      **/
H5garbage_collect()448     public synchronized static native int H5garbage_collect() throws HDF5LibraryException;
449 
450     /**
451      * H5get_libversion retrieves the major, minor, and release numbers of the version of the HDF library which is
452      * linked to the application.
453      *
454      * @param libversion
455      *            The version information of the HDF library.
456      *
457      *            <pre>
458      *      libversion[0] = The major version of the library.
459      *      libversion[1] = The minor version of the library.
460      *      libversion[2] = The release number of the library.
461      * </pre>
462      * @return a non-negative value if successful, along with the version information.
463      *
464      * @exception HDF5LibraryException
465      *                - Error from the HDF-5 Library.
466      **/
H5get_libversion(int[] libversion)467     public synchronized static native int H5get_libversion(int[] libversion) throws HDF5LibraryException;
468 
H5set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim)469     public synchronized static native int H5set_free_list_limits(int reg_global_lim, int reg_list_lim,
470             int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim) throws HDF5LibraryException;
471 
472     /**
473      * H5export_dataset is a utility function to save data in a file.
474      *
475      * @param file_export_name
476      *            The file name to export data into.
477      * @param file_name
478      *            The name of the HDF5 file containing the dataset.
479      * @param object_path
480      *            The full path of the dataset to be exported.
481      * @param binary_order
482      *            99 - export data as text.
483      *            1 - export data as binary Native Order.
484      *            2 - export data as binary Little Endian.
485      *            3 - export data as binary Big Endian.
486      *
487      * @exception HDF5LibraryException
488      *                - Error from the HDF-5 Library.
489      **/
H5export_dataset(String file_export_name, String file_name, String object_path, int binary_order)490     public synchronized static native void H5export_dataset(String file_export_name, String file_name,
491             String object_path, int binary_order) throws HDF5LibraryException;
492 
493     /**
494      * H5is_library_threadsafe Checks to see if the library was built with thread-safety enabled.
495      *
496      * @return true if hdf5 library implements threadsafe
497      *
498      **/
H5is_library_threadsafe()499     private synchronized static native boolean H5is_library_threadsafe();
500 
501     // /////// unimplemented ////////
502     //  herr_t H5free_memory(void *mem);
503     //  void *H5allocate_memory(size_t size, hbool_t clear);
504     //  void *H5resize_memory(void *mem, size_t size);
505 
506     // ////////////////////////////////////////////////////////////
507     // //
508     // H5A: HDF5 1.8 Attribute Interface API Functions //
509     // //
510     // ////////////////////////////////////////////////////////////
511 
512     /**
513      * H5Aclose terminates access to the attribute specified by its identifier, attr_id.
514      *
515      * @param attr_id
516      *            IN: Attribute to release access to.
517      *
518      * @return a non-negative value if successful
519      *
520      * @exception HDF5LibraryException
521      *                - Error from the HDF-5 Library.
522      **/
H5Aclose(long attr_id)523     public static int H5Aclose(long attr_id) throws HDF5LibraryException {
524         if (attr_id < 0)
525             return 0; // throw new HDF5LibraryException("Negative ID");;
526 
527         log.trace("OPEN_IDS: H5Aclose remove {}", attr_id);
528         OPEN_IDS.remove(attr_id);
529         log.trace("OPEN_IDS: {}", OPEN_IDS.size());
530         return _H5Aclose(attr_id);
531     }
532 
_H5Aclose(long attr_id)533     private synchronized static native int _H5Aclose(long attr_id) throws HDF5LibraryException;
534 
535     /**
536      * H5Acopy copies the content of one attribute to another.
537      *
538      * @param src_aid
539      *            the identifier of the source attribute
540      * @param dst_aid
541      *            the identifier of the destination attribute
542      *
543      * @return a non-negative value if successful
544      *
545      * @exception HDF5LibraryException
546      *                - Error from the HDF-5 Library.
547      */
H5Acopy(long src_aid, long dst_aid)548     public synchronized static native int H5Acopy(long src_aid, long dst_aid) throws HDF5LibraryException;
549 
550     /**
551      * H5Acreate creates an attribute, attr_name, which is attached to the object specified by the identifier loc_id.
552      *
553      * @param loc_id
554      *            IN: Location or object identifier; may be dataset or group
555      * @param attr_name
556      *            IN: Attribute name
557      * @param type_id
558      *            IN: Attribute datatype identifier
559      * @param space_id
560      *            IN: Attribute dataspace identifier
561      * @param acpl_id
562      *            IN: Attribute creation property list identifier
563      * @param aapl_id
564      *            IN: Attribute access property list identifier
565      *
566      * @return An attribute identifier if successful; otherwise returns a negative value.
567      *
568      * @exception HDF5LibraryException
569      *                - Error from the HDF-5 Library.
570      * @exception NullPointerException
571      *                - Name is null.
572      **/
H5Acreate(long loc_id, String attr_name, long type_id, long space_id, long acpl_id, long aapl_id)573     public static long H5Acreate(long loc_id, String attr_name, long type_id, long space_id, long acpl_id, long aapl_id)
574             throws HDF5LibraryException, NullPointerException {
575         long id = _H5Acreate2(loc_id, attr_name, type_id, space_id, acpl_id, aapl_id);
576         if (id > 0) {
577             log.trace("OPEN_IDS: H5A create add {}", id);
578             OPEN_IDS.add(id);
579             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
580         }
581         return id;
582     }
583 
584     /**
585      * H5Acreate2 an attribute, attr_name, which is attached to the object specified by the identifier loc_id.
586      *
587      * @see public static long H5Acreate( long loc_id, String attr_name, long type_id, long space_id, long acpl_id, long
588      *      aapl_id )
589      **/
_H5Acreate2(long loc_id, String attr_name, long type_id, long space_id, long acpl_id, long aapl_id)590     private synchronized static native long _H5Acreate2(long loc_id, String attr_name, long type_id, long space_id,
591             long acpl_id, long aapl_id) throws HDF5LibraryException, NullPointerException;
592 
593     /**
594      * H5Acreate_by_name creates an attribute, attr_name, which is attached to the object specified by loc_id and
595      * obj_name.
596      *
597      * @param loc_id
598      *            IN: Location or object identifier; may be dataset or group
599      * @param obj_name
600      *            IN: Name, relative to loc_id, of object that attribute is to be attached to
601      * @param attr_name
602      *            IN: Attribute name
603      * @param type_id
604      *            IN: Attribute datatype identifier
605      * @param space_id
606      *            IN: Attribute dataspace identifier
607      * @param acpl_id
608      *            IN: Attribute creation property list identifier (currently not used).
609      * @param aapl_id
610      *            IN: Attribute access property list identifier (currently not used).
611      * @param lapl_id
612      *            IN: Link access property list
613      *
614      * @return An attribute identifier if successful; otherwise returns a negative value.
615      *
616      * @exception HDF5LibraryException
617      *                - Error from the HDF-5 Library.
618      * @exception NullPointerException
619      *                - name is null.
620      **/
H5Acreate_by_name(long loc_id, String obj_name, String attr_name, long type_id, long space_id, long acpl_id, long aapl_id, long lapl_id)621     public static long H5Acreate_by_name(long loc_id, String obj_name, String attr_name, long type_id, long space_id,
622             long acpl_id, long aapl_id, long lapl_id) throws HDF5LibraryException, NullPointerException {
623         long id = _H5Acreate_by_name(loc_id, obj_name, attr_name, type_id, space_id, acpl_id, aapl_id, lapl_id);
624         if (id > 0) {
625             log.trace("OPEN_IDS: H5Acreate_by_name add {}", id);
626             OPEN_IDS.add(id);
627             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
628         }
629         return id;
630     }
631 
_H5Acreate_by_name(long loc_id, String obj_name, String attr_name, long type_id, long space_id, long acpl_id, long aapl_id, long lapl_id)632     private synchronized static native long _H5Acreate_by_name(long loc_id, String obj_name, String attr_name,
633             long type_id, long space_id, long acpl_id, long aapl_id, long lapl_id) throws HDF5LibraryException,
634             NullPointerException;
635 
636     /**
637      * H5Adelete removes the attribute specified by its name, name, from a dataset, group, or named datatype.
638      *
639      * @param loc_id
640      *            IN: Identifier of the dataset, group, or named datatype.
641      * @param name
642      *            IN: Name of the attribute to delete.
643      *
644      * @return a non-negative value if successful
645      *
646      * @exception HDF5LibraryException
647      *                - Error from the HDF-5 Library.
648      * @exception NullPointerException
649      *                - name is null.
650      **/
H5Adelete(long loc_id, String name)651     public synchronized static native int H5Adelete(long loc_id, String name) throws HDF5LibraryException,
652             NullPointerException;
653 
654     /**
655      * H5Adelete_by_idx removes an attribute, specified by its location in an index, from an object.
656      *
657      * @param loc_id
658      *            IN: Location or object identifier; may be dataset or group
659      * @param obj_name
660      *            IN: Name of object, relative to location, from which attribute is to be removed
661      * @param idx_type
662      *            IN: Type of index
663      * @param order
664      *            IN: Order in which to iterate over index
665      * @param n
666      *            IN: Offset within index
667      * @param lapl_id
668      *            IN: Link access property list identifier
669      *
670      * @exception HDF5LibraryException
671      *                - Error from the HDF-5 Library.
672      * @exception NullPointerException
673      *                - obj_name is null.
674      **/
H5Adelete_by_idx(long loc_id, String obj_name, int idx_type, int order, long n, long lapl_id)675     public synchronized static native void H5Adelete_by_idx(long loc_id, String obj_name, int idx_type, int order,
676             long n, long lapl_id) throws HDF5LibraryException, NullPointerException;
677 
678     /**
679      * H5Adelete_by_name removes the attribute attr_name from an object specified by location and name, loc_id and
680      * obj_name, respectively.
681      *
682      * @param loc_id
683      *            IN: Location or object identifier; may be dataset or group
684      * @param obj_name
685      *            IN: Name of object, relative to location, from which attribute is to be removed
686      * @param attr_name
687      *            IN: Name of attribute to delete
688      * @param lapl_id
689      *            IN: Link access property list identifier.
690      *
691      * @return a non-negative value if successful; otherwise returns a negative value.
692      *
693      * @exception HDF5LibraryException
694      *                - Error from the HDF-5 Library.
695      * @exception NullPointerException
696      *                - name is null.
697      **/
H5Adelete_by_name(long loc_id, String obj_name, String attr_name, long lapl_id)698     public synchronized static native int H5Adelete_by_name(long loc_id, String obj_name, String attr_name, long lapl_id)
699             throws HDF5LibraryException, NullPointerException;
700 
701     /**
702      * H5Aexists determines whether the attribute attr_name exists on the object specified by obj_id.
703      *
704      * @param obj_id
705      *            IN: Object identifier.
706      * @param attr_name
707      *            IN: Name of the attribute.
708      *
709      * @return boolean true if an attribute with a given name exists.
710      *
711      * @exception HDF5LibraryException
712      *                - Error from the HDF-5 Library.
713      * @exception NullPointerException
714      *                - attr_name is null.
715      **/
H5Aexists(long obj_id, String attr_name)716     public synchronized static native boolean H5Aexists(long obj_id, String attr_name) throws HDF5LibraryException,
717             NullPointerException;
718 
719     /**
720      * H5Aexists_by_name determines whether the attribute attr_name exists on an object. That object is specified by its
721      * location and name, loc_id and obj_name, respectively.
722      *
723      * @param loc_id
724      *            IN: Location of object to which attribute is attached .
725      * @param obj_name
726      *            IN: Name, relative to loc_id, of object that attribute is attached to.
727      * @param attr_name
728      *            IN: Name of attribute.
729      * @param lapl_id
730      *            IN: Link access property list identifier.
731      *
732      * @return boolean true if an attribute with a given name exists, otherwise returns false.
733      *
734      * @exception HDF5LibraryException
735      *                - Error from the HDF-5 Library.
736      * @exception NullPointerException
737      *                - name is null.
738      **/
H5Aexists_by_name(long loc_id, String obj_name, String attr_name, long lapl_id)739     public synchronized static native boolean H5Aexists_by_name(long loc_id, String obj_name, String attr_name,
740             long lapl_id) throws HDF5LibraryException, NullPointerException;
741 
742     /**
743      * H5Aget_info retrieves attribute information, by attribute identifier.
744      *
745      * @param attr_id
746      *            IN: Attribute identifier
747      *
748      * @return A buffer(H5A_info_t) for Attribute information
749      *
750      * @exception HDF5LibraryException
751      *                - Error from the HDF-5 Library.
752      **/
H5Aget_info(long attr_id)753     public synchronized static native H5A_info_t H5Aget_info(long attr_id) throws HDF5LibraryException;
754 
755     /**
756      * H5Aget_info_by_idx Retrieves attribute information, by attribute index position.
757      *
758      * @param loc_id
759      *            IN: Location of object to which attribute is attached
760      * @param obj_name
761      *            IN: Name of object to which attribute is attached, relative to location
762      * @param idx_type
763      *            IN: Type of index
764      * @param order
765      *            IN: Index traversal order
766      * @param n
767      *            IN: Attribute's position in index
768      * @param lapl_id
769      *            IN: Link access property list
770      *
771      * @return A buffer(H5A_info_t) for Attribute information
772      *
773      * @exception HDF5LibraryException
774      *                - Error from the HDF-5 Library.
775      * @exception NullPointerException
776      *                - obj_name is null.
777      **/
H5Aget_info_by_idx(long loc_id, String obj_name, int idx_type, int order, long n, long lapl_id)778     public synchronized static native H5A_info_t H5Aget_info_by_idx(long loc_id, String obj_name, int idx_type,
779             int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException;
780 
781     /**
782      * H5Aget_info_by_name Retrieves attribute information, by attribute name.
783      *
784      * @param loc_id
785      *            IN: Location of object to which attribute is attached
786      * @param obj_name
787      *            IN: Name of object to which attribute is attached, relative to location
788      * @param attr_name
789      *            IN: Attribute name
790      * @param lapl_id
791      *            IN: Link access property list
792      *
793      * @return A buffer(H5A_info_t) for Attribute information
794      *
795      * @exception HDF5LibraryException
796      *                - Error from the HDF-5 Library.
797      * @exception NullPointerException
798      *                - obj_name is null.
799      **/
H5Aget_info_by_name(long loc_id, String obj_name, String attr_name, long lapl_id)800     public synchronized static native H5A_info_t H5Aget_info_by_name(long loc_id, String obj_name, String attr_name,
801             long lapl_id) throws HDF5LibraryException, NullPointerException;
802 
803     /**
804      * H5Aget_name retrieves the name of an attribute specified by the identifier, attr_id.
805      *
806      * @param attr_id
807      *            IN: Identifier of the attribute.
808      *
809      * @return String for Attribute name.
810      *
811      * @exception HDF5LibraryException
812      *                - Error from the HDF-5 Library.
813      **/
H5Aget_name(long attr_id)814     public synchronized static native String H5Aget_name(long attr_id)
815             throws HDF5LibraryException;
816 
817     /**
818      * H5Aget_name_by_idx retrieves the name of an attribute that is attached to an object, which is specified by its
819      * location and name, loc_id and obj_name, respectively.
820      *
821      * @param attr_id
822      *            IN: Attribute identifier
823      * @param obj_name
824      *            IN: Name of object to which attribute is attached, relative to location
825      * @param idx_type
826      *            IN: Type of index
827      * @param order
828      *            IN: Index traversal order
829      * @param n
830      *            IN: Attribute's position in index
831      * @param lapl_id
832      *            IN: Link access property list
833      *
834      * @return String for Attribute name.
835      *
836      * @exception HDF5LibraryException
837      *                - Error from the HDF5 Library.
838      * @exception NullPointerException
839      *                - obj_name is null.
840      **/
H5Aget_name_by_idx(long attr_id, String obj_name, int idx_type, int order, long n, long lapl_id)841     public synchronized static native String H5Aget_name_by_idx(long attr_id, String obj_name, int idx_type, int order,
842             long n, long lapl_id) throws HDF5LibraryException, NullPointerException;
843 
844     /**
845      * H5Aget_space retrieves a copy of the dataspace for an attribute.
846      *
847      * @param attr_id
848      *            IN: Identifier of an attribute.
849      *
850      * @return attribute dataspace identifier if successful
851      *
852      * @exception HDF5LibraryException
853      *                - Error from the HDF-5 Library.
854      **/
H5Aget_space(long attr_id)855     public static long H5Aget_space(long attr_id) throws HDF5LibraryException
856     {
857         long id = _H5Aget_space(attr_id);
858         if (id > 0) {
859             log.trace("OPEN_IDS: H5Aget_space add {}", id);
860             OPEN_IDS.add(id);
861             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
862         }
863         return id;
864     }
865 
_H5Aget_space(long attr_id)866     private synchronized static native long _H5Aget_space(long attr_id) throws HDF5LibraryException;
867 
868     /**
869      * H5Aget_storage_size returns the amount of storage that is required for the specified attribute, attr_id.
870      *
871      * @param attr_id
872      *            IN: Identifier of the attribute to query.
873      *
874      * @return the amount of storage size allocated for the attribute; otherwise returns 0 (zero)
875      *
876      * @exception HDF5LibraryException
877      *                - Error from the HDF-5 Library.
878      **/
H5Aget_storage_size(long attr_id)879     public synchronized static native long H5Aget_storage_size(long attr_id) throws HDF5LibraryException;
880 
881     /**
882      * H5Aget_type retrieves a copy of the datatype for an attribute.
883      *
884      * @param attr_id
885      *            IN: Identifier of an attribute.
886      *
887      * @return a datatype identifier if successful
888      *
889      * @exception HDF5LibraryException
890      *                - Error from the HDF-5 Library.
891      **/
H5Aget_type(long attr_id)892     public static long H5Aget_type(long attr_id) throws HDF5LibraryException
893     {
894         long id = _H5Aget_type(attr_id);
895         if (id > 0) {
896             log.trace("OPEN_IDS: H5Aget_type add {}", id);
897             OPEN_IDS.add(id);
898             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
899         }
900         return id;
901     }
902 
_H5Aget_type(long attr_id)903     private synchronized static native long _H5Aget_type(long attr_id) throws HDF5LibraryException;
904 
905     /**
906      * H5Aopen opens an existing attribute, attr_name, that is attached to an object specified an object identifier,
907      * object_id.
908      *
909      * @param obj_id
910      *            IN: Identifier for object to which attribute is attached
911      * @param attr_name
912      *            IN: Name of attribute to open
913      * @param aapl_id
914      *            IN: Attribute access property list identifier
915      *
916      * @return An attribute identifier if successful; otherwise returns a negative value.
917      *
918      * @exception HDF5LibraryException
919      *                - Error from the HDF-5 Library.
920      * @exception NullPointerException
921      *                - Name is null.
922      **/
H5Aopen(long obj_id, String attr_name, long aapl_id)923     public static long H5Aopen(long obj_id, String attr_name, long aapl_id)
924             throws HDF5LibraryException, NullPointerException
925     {
926         long id = _H5Aopen(obj_id, attr_name, aapl_id);
927         if (id > 0) {
928             log.trace("OPEN_IDS: H5Aopen add {}", id);
929             OPEN_IDS.add(id);
930             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
931         }
932         return id;
933     }
934 
_H5Aopen(long obj_id, String attr_name, long aapl_id)935     private synchronized static native long _H5Aopen(long obj_id, String attr_name, long aapl_id)
936             throws HDF5LibraryException, NullPointerException;
937 
938     /**
939      * H5Aopen_by_idx opens an existing attribute that is attached to an object specified by location and name, loc_id
940      * and obj_name, respectively
941      *
942      * @param loc_id
943      *            IN: Location of object to which attribute is attached
944      * @param obj_name
945      *            IN: Name of object to which attribute is attached, relative to location
946      * @param idx_type
947      *            IN: Type of index
948      * @param order
949      *            IN: Index traversal order
950      * @param n
951      *            IN: Attribute's position in index
952      * @param aapl_id
953      *            IN: Attribute access property list
954      * @param lapl_id
955      *            IN: Link access property list
956      *
957      * @return An attribute identifier if successful; otherwise returns a negative value.
958      *
959      * @exception HDF5LibraryException
960      *                - Error from the HDF-5 Library.
961      * @exception NullPointerException
962      *                - Name is null.
963      **/
H5Aopen_by_idx(long loc_id, String obj_name, int idx_type, int order, long n, long aapl_id, long lapl_id)964     public static long H5Aopen_by_idx(long loc_id, String obj_name, int idx_type, int order, long n, long aapl_id,
965             long lapl_id) throws HDF5LibraryException, NullPointerException
966     {
967         long id = _H5Aopen_by_idx(loc_id, obj_name, idx_type, order, n, aapl_id, lapl_id);
968         if (id > 0) {
969             log.trace("OPEN_IDS: H5Aopen_by_idx add {}", id);
970             OPEN_IDS.add(id);
971             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
972         }
973         return id;
974     }
975 
_H5Aopen_by_idx(long loc_id, String obj_name, int idx_type, int order, long n, long aapl_id, long lapl_id)976     private synchronized static native long _H5Aopen_by_idx(long loc_id, String obj_name, int idx_type, int order,
977             long n, long aapl_id, long lapl_id) throws HDF5LibraryException, NullPointerException;
978 
979     /**
980      * H5Aopen_by_name Opens an attribute for an object by object name and attribute name
981      *
982      * @param loc_id
983      *            IN: Location from which to find object to which attribute is attached
984      * @param obj_name
985      *            IN: Name of object to which attribute is attached, relative to loc_id
986      * @param attr_name
987      *            IN: Name of attribute to open
988      * @param aapl_id
989      *            IN: Attribute access property list
990      * @param lapl_id
991      *            IN: Link access property list identifier
992      *
993      * @return Returns an attribute identifier if successful; otherwise returns a negative value.
994      *
995      * @exception HDF5LibraryException
996      *                - Error from the HDF-5 Library.
997      * @exception NullPointerException
998      *                - obj_name is null.
999      **/
H5Aopen_by_name(long loc_id, String obj_name, String attr_name, long aapl_id, long lapl_id)1000     public static long H5Aopen_by_name(long loc_id, String obj_name, String attr_name, long aapl_id, long lapl_id)
1001             throws HDF5LibraryException, NullPointerException
1002     {
1003         long id = _H5Aopen_by_name(loc_id, obj_name, attr_name, aapl_id, lapl_id);
1004         if (id > 0) {
1005             log.trace("OPEN_IDS: H5Aopen_by_name add {}", id);
1006             OPEN_IDS.add(id);
1007             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
1008         }
1009         return id;
1010     }
1011 
_H5Aopen_by_name(long loc_id, String obj_name, String attr_name, long aapl_id, long lapl_id)1012     private synchronized static native long _H5Aopen_by_name(long loc_id, String obj_name, String attr_name,
1013             long aapl_id, long lapl_id) throws HDF5LibraryException, NullPointerException;
1014 
1015     /**
1016      * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
1017      * mem_type_id. The entire attribute is read into buf from the file.
1018      *
1019      * @param attr_id
1020      *            IN: Identifier of an attribute to read.
1021      * @param mem_type_id
1022      *            IN: Identifier of the attribute datatype (in memory).
1023      * @param obj
1024      *            Buffer to store data read from the file.
1025      * @param isCriticalPinning
1026      *            request lock on data reference.
1027      *
1028      * @return a non-negative value if successful
1029      *
1030      * @exception HDF5LibraryException
1031      *                - Error from the HDF-5 Library.
1032      * @exception NullPointerException
1033      *                - data buffer is null.
1034      **/
H5Aread(long attr_id, long mem_type_id, byte[] obj, boolean isCriticalPinning)1035     public synchronized static native int H5Aread(long attr_id, long mem_type_id, byte[] obj, boolean isCriticalPinning)
1036             throws HDF5LibraryException, NullPointerException;
1037 
H5Aread(long attr_id, long mem_type_id, byte[] buf)1038     public synchronized static int H5Aread(long attr_id, long mem_type_id, byte[] buf) throws HDF5LibraryException, NullPointerException
1039     {
1040         return H5Aread(attr_id, mem_type_id, buf, true);
1041     }
1042 
H5Aread(long attr_id, long mem_type_id, Object obj)1043     public synchronized static int H5Aread(long attr_id, long mem_type_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException
1044     {
1045         return H5Aread(attr_id, mem_type_id, obj, true);
1046     }
1047 
1048     /**
1049      * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
1050      * mem_type_id. The entire attribute is read into data object from the file.
1051      *
1052      * @param attr_id
1053      *            IN: Identifier of an attribute to read.
1054      * @param mem_type_id
1055      *            IN: Identifier of the attribute datatype (in memory).
1056      * @param obj
1057      *            IN: Object for data to be read.
1058      * @param isCriticalPinning
1059      *            request lock on data reference.
1060      *
1061      * @return a non-negative value if successful
1062      *
1063      * @exception HDF5Exception
1064      *                - Failure in the data conversion.
1065      * @exception HDF5LibraryException
1066      *                - Error from the HDF-5 Library.
1067      * @exception NullPointerException
1068      *                - data buffer is null. See public synchronized static native int H5Aread( )
1069      **/
H5Aread(long attr_id, long mem_type_id, Object obj, boolean isCriticalPinning)1070     public synchronized static int H5Aread(long attr_id, long mem_type_id, Object obj, boolean isCriticalPinning)
1071             throws HDF5Exception, HDF5LibraryException, NullPointerException
1072     {
1073         int status = -1;
1074         boolean is1D = false;
1075 
1076         Class dataClass = obj.getClass();
1077         if (!dataClass.isArray()) {
1078             throw (new HDF5JavaException("H5Aread: data is not an array"));
1079         }
1080 
1081         String cname = dataClass.getName();
1082         is1D = (cname.lastIndexOf('[') == cname.indexOf('['));
1083         char dname = cname.charAt(cname.lastIndexOf("[") + 1);
1084         log.trace("H5Aread: cname={} is1D={} dname={}", cname, is1D, dname);
1085 
1086         if (is1D && (dname == 'B')) {
1087             log.trace("H5Aread_dname_B");
1088             status = H5Aread(attr_id, mem_type_id, (byte[]) obj, isCriticalPinning);
1089         }
1090         else if (is1D && (dname == 'S')) {
1091             log.trace("H5Aread_dname_S");
1092             status = H5Aread_short(attr_id, mem_type_id, (short[]) obj, isCriticalPinning);
1093         }
1094         else if (is1D && (dname == 'I')) {
1095             log.trace("H5Aread_dname_I");
1096             status = H5Aread_int(attr_id, mem_type_id, (int[]) obj, isCriticalPinning);
1097         }
1098         else if (is1D && (dname == 'J')) {
1099             log.trace("H5Aread_dname_J");
1100             status = H5Aread_long(attr_id, mem_type_id, (long[]) obj, isCriticalPinning);
1101         }
1102         else if (is1D && (dname == 'F')) {
1103             log.trace("H5Aread_dname_F");
1104             status = H5Aread_float(attr_id, mem_type_id, (float[]) obj, isCriticalPinning);
1105         }
1106         else if (is1D && (dname == 'D')) {
1107             log.trace("H5Aread_dname_D");
1108             status = H5Aread_double(attr_id, mem_type_id, (double[]) obj, isCriticalPinning);
1109         }
1110         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)) {
1111             log.trace("H5Aread_reg_ref");
1112             status = H5Aread_reg_ref(attr_id, mem_type_id, (String[]) obj);
1113         }
1114         else if (is1D && (dataClass.getComponentType() == String.class)) {
1115             log.trace("H5Aread_string type");
1116             status = H5Aread_string(attr_id, mem_type_id, (String[]) obj);
1117         }
1118         else {
1119             // Create a data buffer to hold the data into a Java Array
1120             HDFArray theArray = new HDFArray(obj);
1121             byte[] buf = theArray.emptyBytes();
1122             log.trace("H5Aread_else");
1123 
1124             // This will raise an exception if there is an error
1125             status = H5Aread(attr_id, mem_type_id, buf, isCriticalPinning);
1126 
1127             // No exception: status really ought to be OK
1128             if (status >= 0) {
1129                 obj = theArray.arrayify(buf);
1130             }
1131 
1132             // clean up these: assign 'null' as hint to gc()
1133             buf = null;
1134             theArray = null;
1135         }
1136 
1137         return status;
1138     }
1139 
H5Aread_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning)1140     public synchronized static native int H5Aread_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning)
1141             throws HDF5LibraryException, NullPointerException;
1142 
H5Aread_double(long attr_id, long mem_type_id, double[] buf)1143     public synchronized static int H5Aread_double(long attr_id, long mem_type_id, double[] buf)
1144             throws HDF5LibraryException, NullPointerException
1145     {
1146         return H5Aread_double(attr_id, mem_type_id, buf, true);
1147     }
1148 
H5Aread_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning)1149     public synchronized static native int H5Aread_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning)
1150             throws HDF5LibraryException, NullPointerException;
1151 
H5Aread_float(long attr_id, long mem_type_id, float[] buf)1152     public synchronized static int H5Aread_float(long attr_id, long mem_type_id, float[] buf)
1153             throws HDF5LibraryException, NullPointerException
1154     {
1155         return H5Aread_float(attr_id, mem_type_id, buf, true);
1156     }
1157 
H5Aread_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning)1158     public synchronized static native int H5Aread_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning)
1159             throws HDF5LibraryException, NullPointerException;
1160 
H5Aread_int(long attr_id, long mem_type_id, int[] buf)1161     public synchronized static int H5Aread_int(long attr_id, long mem_type_id, int[] buf)
1162             throws HDF5LibraryException, NullPointerException
1163     {
1164         return H5Aread_int(attr_id, mem_type_id, buf, true);
1165     }
1166 
H5Aread_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning)1167     public synchronized static native int H5Aread_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning)
1168             throws HDF5LibraryException, NullPointerException;
1169 
H5Aread_long(long attr_id, long mem_type_id, long[] buf)1170     public synchronized static int H5Aread_long(long attr_id, long mem_type_id, long[] buf)
1171             throws HDF5LibraryException, NullPointerException
1172     {
1173         return H5Aread_long(attr_id, mem_type_id, buf, true);
1174     }
1175 
H5Aread_reg_ref(long attr_id, long mem_type_id, String[] buf)1176     public synchronized static native int H5Aread_reg_ref(long attr_id, long mem_type_id, String[] buf)
1177             throws HDF5LibraryException, NullPointerException;
1178 
H5Aread_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning)1179     public synchronized static native int H5Aread_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning)
1180             throws HDF5LibraryException, NullPointerException;
1181 
H5Aread_short(long attr_id, long mem_type_id, short[] buf)1182     public synchronized static int H5Aread_short(long attr_id, long mem_type_id, short[] buf)
1183             throws HDF5LibraryException, NullPointerException
1184     {
1185         return H5Aread_short(attr_id, mem_type_id, buf, true);
1186     }
1187 
H5AreadVL(long attr_id, long mem_type_id, Object[] buf)1188     public synchronized static native int H5AreadVL(long attr_id, long mem_type_id, Object[] buf)
1189             throws HDF5LibraryException, NullPointerException;
1190 
H5Aread_string(long attr_id, long mem_type_id, String[] buf)1191     public synchronized static native int H5Aread_string(long attr_id, long mem_type_id, String[] buf)
1192             throws HDF5LibraryException, NullPointerException;
1193 
H5Aread_VLStrings(long attr_id, long mem_type_id, Object[] buf)1194     public synchronized static native int H5Aread_VLStrings(long attr_id, long mem_type_id, Object[] buf)
1195             throws HDF5LibraryException, NullPointerException;
1196 
H5AreadComplex(long attr_id, long mem_type_id, String[] buf)1197     public synchronized static native int H5AreadComplex(long attr_id, long mem_type_id, String[] buf)
1198             throws HDF5LibraryException, NullPointerException;
1199 
1200     /**
1201      * H5Arename changes the name of attribute that is attached to the object specified by loc_id. The attribute named
1202      * old_attr_name is renamed new_attr_name.
1203      *
1204      * @param loc_id
1205      *            IN: Location or object identifier; may be dataset or group
1206      * @param old_attr_name
1207      *            IN: Prior attribute name
1208      * @param new_attr_name
1209      *            IN: New attribute name
1210      *
1211      * @return A non-negative value if successful; otherwise returns a negative value.
1212      *
1213      * @exception HDF5LibraryException
1214      *                - Error from the HDF-5 Library.
1215      * @exception NullPointerException
1216      *                - Name is null.
1217      **/
H5Arename(long loc_id, String old_attr_name, String new_attr_name)1218     public synchronized static native int H5Arename(long loc_id, String old_attr_name, String new_attr_name)
1219             throws HDF5LibraryException, NullPointerException;
1220 
1221     /**
1222      * H5Arename_by_name changes the name of attribute that is attached to the object specified by loc_id and obj_name.
1223      * The attribute named old_attr_name is renamed new_attr_name.
1224      *
1225      * @param loc_id
1226      *            IN: Location or object identifier; may be dataset or group
1227      * @param obj_name
1228      *            IN: Name of object, relative to location, whose attribute is to be renamed
1229      * @param old_attr_name
1230      *            IN: Prior attribute name
1231      * @param new_attr_name
1232      *            IN: New attribute name
1233      * @param lapl_id
1234      *            IN: Link access property list
1235      *
1236      * @return A non-negative value if successful; otherwise returns a negative value.
1237      *
1238      * @exception HDF5LibraryException
1239      *                - Error from the HDF-5 Library.
1240      * @exception NullPointerException
1241      *                - Name is null.
1242      **/
H5Arename_by_name(long loc_id, String obj_name, String old_attr_name, String new_attr_name, long lapl_id)1243     public synchronized static native int H5Arename_by_name(long loc_id, String obj_name, String old_attr_name,
1244             String new_attr_name, long lapl_id) throws HDF5LibraryException, NullPointerException;
1245 
1246     /**
1247      * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
1248      * mem_type_id. The entire attribute is written from buf to the file.
1249      *
1250      * @param attr_id
1251      *            IN: Identifier of an attribute to write.
1252      * @param mem_type_id
1253      *            IN: Identifier of the attribute datatype (in memory).
1254      * @param buf
1255      *            IN: Buffer with data to be written to the file.
1256      * @param isCriticalPinning
1257      *            IN: request lock on data reference.
1258      *
1259      * @return a non-negative value if successful
1260      *
1261      * @exception HDF5LibraryException
1262      *                - Error from the HDF-5 Library.
1263      * @exception NullPointerException
1264      *                - data is null.
1265      **/
H5Awrite(long attr_id, long mem_type_id, byte[] buf, boolean isCriticalPinning)1266     public synchronized static native int H5Awrite(long attr_id, long mem_type_id, byte[] buf, boolean isCriticalPinning)
1267             throws HDF5LibraryException, NullPointerException;
1268 
H5Awrite(long attr_id, long mem_type_id, byte[] buf)1269     public synchronized static int H5Awrite(long attr_id, long mem_type_id, byte[] buf)
1270             throws HDF5LibraryException, NullPointerException
1271     {
1272         return H5Awrite(attr_id, mem_type_id, buf, true);
1273     }
1274 
H5Awrite(long attr_id, long mem_type_id, Object obj)1275     public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj)
1276             throws HDF5Exception, HDF5LibraryException, NullPointerException
1277     {
1278         return H5Awrite(attr_id, mem_type_id, obj, true);
1279     }
1280 
1281     /**
1282      * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
1283      * mem_type_id. The entire attribute is written from data object to the file.
1284      *
1285      * @param attr_id
1286      *            IN: Identifier of an attribute to write.
1287      * @param mem_type_id
1288      *            IN: Identifier of the attribute datatype (in memory).
1289      * @param obj
1290      *            IN: Data object to be written.
1291      * @param isCriticalPinning
1292      *            request lock on data reference.
1293      *
1294      * @return a non-negative value if successful
1295      *
1296      * @exception HDF5Exception
1297      *                - Failure in the data conversion.
1298      * @exception HDF5LibraryException
1299      *                - Error from the HDF-5 Library.
1300      * @exception NullPointerException
1301      *                - data object is null
1302      **/
H5Awrite(long attr_id, long mem_type_id, Object obj, boolean isCriticalPinning)1303     public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj, boolean isCriticalPinning)
1304             throws HDF5Exception, HDF5LibraryException, NullPointerException
1305     {
1306         int status = -1;
1307         boolean is1D = false;
1308 
1309         Class dataClass = obj.getClass();
1310         if (!dataClass.isArray()) {
1311             throw (new HDF5JavaException("H5Dwrite: data is not an array"));
1312         }
1313 
1314         String cname = dataClass.getName();
1315         is1D = (cname.lastIndexOf('[') == cname.indexOf('['));
1316         char dname = cname.charAt(cname.lastIndexOf("[") + 1);
1317 
1318         if (is1D && (dname == 'B')) {
1319             status = H5Awrite(attr_id, mem_type_id, (byte[]) obj, isCriticalPinning);
1320         }
1321         else if (is1D && (dname == 'S')) {
1322             status = H5Awrite_short(attr_id, mem_type_id, (short[]) obj, isCriticalPinning);
1323         }
1324         else if (is1D && (dname == 'I')) {
1325             status = H5Awrite_int(attr_id, mem_type_id, (int[]) obj, isCriticalPinning);
1326         }
1327         else if (is1D && (dname == 'J')) {
1328             status = H5Awrite_long(attr_id, mem_type_id, (long[]) obj, isCriticalPinning);
1329         }
1330         else if (is1D && (dname == 'F')) {
1331             status = H5Awrite_float(attr_id, mem_type_id, (float[]) obj, isCriticalPinning);
1332         }
1333         else if (is1D && (dname == 'D')) {
1334             status = H5Awrite_double(attr_id, mem_type_id, (double[]) obj, isCriticalPinning);
1335         }
1336         else if (is1D && (dataClass.getComponentType() == String.class)) {
1337             log.trace("H5Dwrite_string type");
1338             status = H5Awrite_string(attr_id, mem_type_id, (String[]) obj);
1339         }
1340         else {
1341             HDFArray theArray = new HDFArray(obj);
1342             byte[] buf = theArray.byteify();
1343 
1344             status = H5Awrite(attr_id, mem_type_id, buf);
1345             buf = null;
1346             theArray = null;
1347         }
1348 
1349         return status;
1350     }
1351 
H5Awrite_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning)1352     public synchronized static native int H5Awrite_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning)
1353             throws HDF5LibraryException, NullPointerException;
1354 
H5Awrite_double(long attr_id, long mem_type_id, double[] buf)1355     public synchronized static int H5Awrite_double(long attr_id, long mem_type_id, double[] buf)
1356             throws HDF5LibraryException, NullPointerException
1357     {
1358         return H5Awrite_double(attr_id, mem_type_id, buf, true);
1359     }
1360 
H5Awrite_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning)1361     public synchronized static native int H5Awrite_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning)
1362             throws HDF5LibraryException, NullPointerException;
1363 
H5Awrite_float(long attr_id, long mem_type_id, float[] buf)1364     public synchronized static int H5Awrite_float(long attr_id, long mem_type_id, float[] buf)
1365             throws HDF5LibraryException, NullPointerException
1366     {
1367         return H5Awrite_float(attr_id, mem_type_id, buf, true);
1368     }
1369 
H5Awrite_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning)1370     public synchronized static native int H5Awrite_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning)
1371             throws HDF5LibraryException, NullPointerException;
1372 
H5Awrite_int(long attr_id, long mem_type_id, int[] buf)1373     public synchronized static int H5Awrite_int(long attr_id, long mem_type_id, int[] buf)
1374             throws HDF5LibraryException, NullPointerException
1375     {
1376         return H5Awrite_int(attr_id, mem_type_id, buf, true);
1377     }
1378 
H5Awrite_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning)1379     public synchronized static native int H5Awrite_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning)
1380             throws HDF5LibraryException, NullPointerException;
1381 
H5Awrite_long(long attr_id, long mem_type_id, long[] buf)1382     public synchronized static int H5Awrite_long(long attr_id, long mem_type_id, long[] buf)
1383             throws HDF5LibraryException, NullPointerException
1384     {
1385         return H5Awrite_long(attr_id, mem_type_id, buf, true);
1386     }
1387 
H5Awrite_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning)1388     public synchronized static native int H5Awrite_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning)
1389             throws HDF5LibraryException, NullPointerException;
1390 
H5Awrite_short(long attr_id, long mem_type_id, short[] buf)1391     public synchronized static int H5Awrite_short(long attr_id, long mem_type_id, short[] buf)
1392             throws HDF5LibraryException, NullPointerException
1393     {
1394         return H5Awrite_short(attr_id, mem_type_id, buf, true);
1395     }
1396 
H5Awrite_string(long attr_id, long mem_type_id, String[] buf)1397     public synchronized static native int H5Awrite_string(long attr_id, long mem_type_id, String[] buf)
1398             throws HDF5LibraryException, NullPointerException;
1399 
H5AwriteVL(long attr_id, long mem_type_id, Object[] buf)1400     public synchronized static native int H5AwriteVL(long attr_id, long mem_type_id, Object[] buf)
1401             throws HDF5LibraryException, NullPointerException;
1402 
1403     /**
1404      * H5Awrite_VLStrings writes a variable length String dataset, specified by its identifier attr_id, from
1405      * the application memory buffer buf into the file.
1406      *
1407      * ---- contributed by Rosetta Biosoftware
1408      *
1409      * @param attr_id
1410      *            Identifier of the attribute read from.
1411      * @param mem_type_id
1412      *            Identifier of the memory datatype.
1413      * @param buf
1414      *            Buffer with data to be written to the file.
1415      *
1416      * @return a non-negative value if successful
1417      *
1418      * @exception HDF5LibraryException
1419      *                - Error from the HDF-5 Library.
1420      * @exception NullPointerException
1421      *                - name is null.
1422      **/
1423 
H5Awrite_VLStrings(long attr_id, long mem_type_id, Object[] buf)1424     public synchronized static native int H5Awrite_VLStrings(long attr_id, long mem_type_id, Object[] buf)
1425             throws HDF5LibraryException, NullPointerException;
1426 
1427     /**
1428      * H5Aget_create_plist retrieves a copy of the attribute creation property list identifier.
1429      *
1430      * @param attr_id
1431      *            IN: Identifier of an attribute.
1432      *
1433      * @return identifier for the attribute's creation property list if successful
1434      *
1435      * @exception HDF5LibraryException
1436      *                - Error from the HDF-5 Library.
1437      **/
H5Aget_create_plist(long attr_id)1438     public static long H5Aget_create_plist(long attr_id)
1439             throws HDF5LibraryException
1440     {
1441         long id = _H5Aget_create_plist(attr_id);
1442         if (id > 0) {
1443             log.trace("OPEN_IDS: H5Aget_create_plist add {}", id);
1444             OPEN_IDS.add(id);
1445             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
1446         }
1447         return id;
1448     }
1449 
_H5Aget_create_plist(long attr_id)1450     private synchronized static native long _H5Aget_create_plist(long attr_id) throws HDF5LibraryException;
1451 
1452     /**
1453      * H5Aiterate2 iterates over the attributes attached to a dataset, named datatype, or group, as
1454      * specified by obj_id. For each attribute, user-provided data, op_data, with additional information
1455      * as defined below, is passed to a user-defined function, op, which operates on that attribute.
1456      *
1457      * @param loc_id
1458      *            IN: Identifier for object to which attributes are attached; may be group, dataset, or named datatype.
1459      * @param idx_type
1460      *            IN: The type of index specified by idx_type can be one of the following:
1461      *                      H5_INDEX_NAME             An alpha-numeric index by attribute name.
1462      *                      H5_INDEX_CRT_ORDER        An index by creation order.
1463      * @param order
1464      *            IN: The order in which the index is to be traversed, as specified by order, can be one of the following:
1465      *                      H5_ITER_INC     Iteration is from beginning to end, i.e., a top-down iteration
1466      *                                      incrementing the index position at each step.
1467      *                      H5_ITER_DEC     Iteration starts at the end of the index, i.e., a bottom-up iteration
1468      *                                      decrementing the index position at each step.
1469      *                      H5_ITER_NATIVE  HDF5 iterates in the fastest-available order. No information is provided
1470      *                                      as to the order, but HDF5 ensures that each element in the index will be
1471      *                                      visited if the iteration completes successfully.
1472      * @param idx
1473      *            IN/OUT: Initial and returned offset within index.
1474      * @param op
1475      *            IN: Callback function to operate on each value.
1476      * @param op_data
1477      *            IN/OUT: Pointer to any user-efined data for use by operator function.
1478      *
1479      * @return returns the return value of the first operator that returns a positive value, or zero if all members were
1480      *         processed with no operator returning non-zero.
1481      *
1482      * @exception HDF5LibraryException
1483      *                - Error from the HDF-5 Library.
1484      * @exception NullPointerException
1485      *                - buf is null.
1486      **/
H5Aiterate(long loc_id, int idx_type, int order, long idx, H5A_iterate_cb op, H5A_iterate_t op_data)1487      public synchronized static native int H5Aiterate(long loc_id, int idx_type, int order, long idx,
1488                  H5A_iterate_cb op, H5A_iterate_t op_data) throws HDF5LibraryException, NullPointerException;
1489 
1490     /**
1491      * H5Aiterate_by_name iterates over the attributes attached to the dataset or group specified with loc_id
1492      * and obj_name. For each attribute, user-provided data, op_data, with additional information as defined
1493      * below, is passed to a user-defined function, op, which operates on that attribute.
1494      *
1495      * @param loc_id
1496      *            IN: Identifier for object to which attributes are attached; may be group, dataset, or named datatype.
1497      * @param obj_name
1498      *            IN: Name of object, relative to location.
1499      * @param idx_type
1500      *            IN: The type of index specified by idx_type can be one of the following:
1501      *                      H5_INDEX_NAME             An alpha-numeric index by attribute name.
1502      *                      H5_INDEX_CRT_ORDER        An index by creation order.
1503      * @param order
1504      *            IN: The order in which the index is to be traversed, as specified by order, can be one of the following:
1505      *                      H5_ITER_INC     Iteration is from beginning to end, i.e., a top-down iteration
1506      *                                      incrementing the index position at each step.
1507      *                      H5_ITER_DEC     Iteration starts at the end of the index, i.e., a bottom-up iteration
1508      *                                      decrementing the index position at each step.
1509      *                      H5_ITER_NATIVE  HDF5 iterates in the fastest-available order. No information is provided
1510      *                                      as to the order, but HDF5 ensures that each element in the index will be
1511      *                                      visited if the iteration completes successfully.
1512      * @param idx
1513      *            IN/OUT: Initial and returned offset within index.
1514      * @param op
1515      *            IN: Callback function to operate on each value.
1516      * @param op_data
1517      *            IN/OUT: Pointer to any user-efined data for use by operator function.
1518      * @param lapl_id
1519      *            IN: Link access property list
1520      *
1521      * @return returns the return value of the first operator that returns a positive value, or zero if all members were
1522      *         processed with no operator returning non-zero.
1523      *
1524      * @exception HDF5LibraryException
1525      *                - Error from the HDF-5 Library.
1526      * @exception NullPointerException
1527      *                - buf is null.
1528      **/
H5Aiterate_by_name(long loc_id, String obj_name, int idx_type, int order, long idx, H5A_iterate_cb op, H5A_iterate_t op_data, long lapl_id)1529      public synchronized static native int H5Aiterate_by_name(long loc_id, String obj_name, int idx_type,
1530                         int order, long idx, H5A_iterate_cb op, H5A_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException;
1531 
1532     // ////////////////////////////////////////////////////////////
1533     // //
1534     // H5AC: Cache Interface Functions //
1535     // //
1536     // ////////////////////////////////////////////////////////////
1537 
1538     // No public Functions
1539 
1540     // ////////////////////////////////////////////////////////////
1541     // //
1542     // H5B: B-link-tree Interface Functions //
1543     // //
1544     // ////////////////////////////////////////////////////////////
1545 
1546     // No public Functions
1547 
1548     // ////////////////////////////////////////////////////////////
1549     // //
1550     // H5B2: v2 B-tree Interface Functions //
1551     // //
1552     // ////////////////////////////////////////////////////////////
1553 
1554     // No public Functions
1555 
1556     // ////////////////////////////////////////////////////////////
1557     // //
1558     // H5C: Cache Interface Functions //
1559     // //
1560     // ////////////////////////////////////////////////////////////
1561 
1562     // No public Functions
1563 
1564     // ////////////////////////////////////////////////////////////
1565     // //
1566     // H5D: Datasets Interface Functions //
1567     // //
1568     // ////////////////////////////////////////////////////////////
1569 
1570     /**
1571      * H5Dcopy copies the content of one dataset to another dataset.
1572      *
1573      * @param src_did
1574      *            the identifier of the source dataset
1575      * @param dst_did
1576      *            the identifier of the destinaiton dataset
1577      *
1578      * @return a non-negative value if successful
1579      *
1580      * @exception HDF5LibraryException
1581      *                - Error from the HDF-5 Library.
1582      */
H5Dcopy(long src_did, long dst_did)1583     public synchronized static native int H5Dcopy(long src_did, long dst_did) throws HDF5LibraryException;
1584 
1585     /**
1586      * H5Dclose ends access to a dataset specified by dataset_id and releases resources used by it.
1587      *
1588      * @param dataset_id
1589      *            Identifier of the dataset to finish access to.
1590      *
1591      * @return a non-negative value if successful
1592      *
1593      * @exception HDF5LibraryException
1594      *                - Error from the HDF-5 Library.
1595      **/
H5Dclose(long dataset_id)1596     public static int H5Dclose(long dataset_id) throws HDF5LibraryException {
1597         if (dataset_id < 0)
1598             return 0; // throw new HDF5LibraryException("Negative ID");
1599 
1600         log.trace("OPEN_IDS: H5Dclose remove {}", dataset_id);
1601         OPEN_IDS.remove(dataset_id);
1602         log.trace("OPEN_IDS: {}", OPEN_IDS.size());
1603         return _H5Dclose(dataset_id);
1604     }
1605 
_H5Dclose(long dataset_id)1606     private synchronized static native int _H5Dclose(long dataset_id) throws HDF5LibraryException;
1607 
1608     /**
1609      * H5Dcreate creates a new dataset named name at the location specified by loc_id.
1610      *
1611      * @param loc_id
1612      *            IN: Location identifier
1613      * @param name
1614      *            IN: Dataset name
1615      * @param type_id
1616      *            IN: Datatype identifier
1617      * @param space_id
1618      *            IN: Dataspace identifier
1619      * @param lcpl_id
1620      *            IN: Identifier of link creation property list.
1621      * @param dcpl_id
1622      *            IN: Identifier of dataset creation property list.
1623      * @param dapl_id
1624      *            IN: Identifier of dataset access property list.
1625      *
1626      * @return a dataset identifier
1627      *
1628      * @exception HDF5LibraryException
1629      *                - Error from the HDF-5 Library.
1630      * @exception NullPointerException
1631      *                - name is null.
1632      **/
H5Dcreate(long loc_id, String name, long type_id, long space_id, long lcpl_id, long dcpl_id, long dapl_id)1633     public static long H5Dcreate(long loc_id, String name, long type_id, long space_id, long lcpl_id, long dcpl_id,
1634             long dapl_id) throws HDF5LibraryException, NullPointerException {
1635         long id = _H5Dcreate2(loc_id, name, type_id, space_id, lcpl_id, dcpl_id, dapl_id);
1636         if (id > 0) {
1637             log.trace("OPEN_IDS: H5Dcreate add {}", id);
1638             OPEN_IDS.add(id);
1639             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
1640         }
1641         return id;
1642     }
1643 
1644     /**
1645      * H5Dcreate2 creates a new dataset named name at the location specified by loc_id.
1646      *
1647      * @see public static int H5Dcreate(int loc_id, String name, int type_id, int space_id, int lcpl_id, int dcpl_id,
1648      *      int dapl_id)
1649      **/
_H5Dcreate2(long loc_id, String name, long type_id, long space_id, long lcpl_id, long dcpl_id, long dapl_id)1650     private synchronized static native long _H5Dcreate2(long loc_id, String name, long type_id, long space_id,
1651             long lcpl_id, long dcpl_id, long dapl_id) throws HDF5LibraryException, NullPointerException;
1652 
1653     /**
1654      * H5Dcreate_anon creates a dataset in the file specified by loc_id.
1655      *
1656      * @param loc_id
1657      *            IN: Location identifier
1658      * @param type_id
1659      *            IN: Datatype identifier
1660      * @param space_id
1661      *            IN: Dataspace identifier
1662      * @param dcpl_id
1663      *            IN: Identifier of dataset creation property list.
1664      * @param dapl_id
1665      *            IN: Identifier of dataset access property list.
1666      *
1667      * @return a dataset identifier
1668      *
1669      * @exception HDF5LibraryException
1670      *                - Error from the HDF-5 Library.
1671      **/
H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id, long dapl_id)1672     public static long H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id, long dapl_id)
1673             throws HDF5LibraryException {
1674         long id = _H5Dcreate_anon(loc_id, type_id, space_id, dcpl_id, dapl_id);
1675         if (id > 0) {
1676             log.trace("OPEN_IDS: H5Dcreate_anon add {}", id);
1677             OPEN_IDS.add(id);
1678             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
1679         }
1680         return id;
1681     }
1682 
_H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id, long dapl_id)1683     private synchronized static native long _H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id,
1684             long dapl_id) throws HDF5LibraryException;
1685 
1686     /**
1687      * H5Dfill explicitly fills the dataspace selection in memory, space_id, with the fill value specified in fill.
1688      *
1689      * @param fill
1690      *            IN: Pointer to the fill value to be used.
1691      * @param fill_type
1692      *            IN: Fill value datatype identifier.
1693      * @param buf
1694      *            IN/OUT: Pointer to the memory buffer containing the selection to be filled.
1695      * @param buf_type
1696      *            IN: Datatype of dataspace elements to be filled.
1697      * @param space_id
1698      *            IN: Dataspace describing memory buffer and containing the selection to be filled.
1699      *
1700      * @exception HDF5LibraryException
1701      *                - Error from the HDF-5 Library.
1702      * @exception NullPointerException
1703      *                - buf is null.
1704      **/
H5Dfill(byte[] fill, long fill_type, byte[] buf, long buf_type, long space_id)1705     public synchronized static native void H5Dfill(byte[] fill, long fill_type, byte[] buf, long buf_type, long space_id)
1706             throws HDF5LibraryException, NullPointerException;
1707 
1708     /**
1709      * H5Dget_access_plist returns an identifier for a copy of the dataset access property list for a dataset.
1710      *
1711      * @param dset_id
1712      *            IN: Identifier of the dataset to query.
1713      *
1714      * @return a dataset access property list identifier
1715      *
1716      * @exception HDF5LibraryException
1717      *                - Error from the HDF-5 Library.
1718      **/
H5Dget_access_plist(long dset_id)1719     public synchronized static native long H5Dget_access_plist(long dset_id) throws HDF5LibraryException;
1720 
1721     /**
1722      * H5Dget_create_plist returns an identifier for a copy of the dataset creation property list for a dataset.
1723      *
1724      * @param dataset_id
1725      *            Identifier of the dataset to query.
1726      * @return a dataset creation property list identifier if successful
1727      *
1728      * @exception HDF5LibraryException
1729      *                - Error from the HDF-5 Library.
1730      **/
H5Dget_create_plist(long dataset_id)1731     public static long H5Dget_create_plist(long dataset_id) throws HDF5LibraryException {
1732         long id = _H5Dget_create_plist(dataset_id);
1733         if (id > 0) {
1734             log.trace("OPEN_IDS: H5Dget_create_plist add {}", id);
1735             OPEN_IDS.add(id);
1736             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
1737         }
1738         return id;
1739     }
1740 
_H5Dget_create_plist(long dataset_id)1741     private synchronized static native long _H5Dget_create_plist(long dataset_id) throws HDF5LibraryException;
1742 
1743     /**
1744      * H5Dget_offset returns the address in the file of the dataset dset_id.
1745      *
1746      * @param dset_id
1747      *            IN: Identifier of the dataset in question
1748      *
1749      * @return the offset in bytes.
1750      *
1751      * @exception HDF5LibraryException
1752      *                - Error from the HDF-5 Library.
1753      **/
H5Dget_offset(long dset_id)1754     public synchronized static native long H5Dget_offset(long dset_id) throws HDF5LibraryException;
1755 
1756     /**
1757      * H5Dget_space returns an identifier for a copy of the dataspace for a dataset.
1758      *
1759      * @param dataset_id
1760      *            Identifier of the dataset to query.
1761      *
1762      * @return a dataspace identifier if successful
1763      *
1764      * @exception HDF5LibraryException
1765      *                - Error from the HDF-5 Library.
1766      **/
H5Dget_space(long dataset_id)1767     public static long H5Dget_space(long dataset_id) throws HDF5LibraryException {
1768         long id = _H5Dget_space(dataset_id);
1769         if (id > 0) {
1770             log.trace("OPEN_IDS: H5Dget_space add {}", id);
1771             OPEN_IDS.add(id);
1772             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
1773         }
1774         return id;
1775     }
1776 
_H5Dget_space(long dataset_id)1777     private synchronized static native long _H5Dget_space(long dataset_id) throws HDF5LibraryException;
1778 
1779     /**
1780      * H5Dget_space_status determines whether space has been allocated for the dataset dset_id.
1781      *
1782      * @param dset_id
1783      *            IN: Identifier of the dataset to query.
1784      *
1785      * @return the space allocation status
1786      *
1787      * @exception HDF5LibraryException
1788      *                - Error from the HDF-5 Library.
1789      **/
H5Dget_space_status(long dset_id)1790     public synchronized static native int H5Dget_space_status(long dset_id) throws HDF5LibraryException;
1791 
1792     /**
1793      * H5Dget_storage_size returns the amount of storage that is required for the dataset.
1794      *
1795      * @param dataset_id
1796      *            Identifier of the dataset in question
1797      *
1798      * @return he amount of storage space allocated for the dataset.
1799      *
1800      * @exception HDF5LibraryException
1801      *                - Error from the HDF-5 Library.
1802      **/
H5Dget_storage_size(long dataset_id)1803     public synchronized static native long H5Dget_storage_size(long dataset_id) throws HDF5LibraryException,
1804             IllegalArgumentException;
1805 
1806     /**
1807      * H5Dget_type returns an identifier for a copy of the datatype for a dataset.
1808      *
1809      * @param dataset_id
1810      *            Identifier of the dataset to query.
1811      *
1812      * @return a datatype identifier if successful
1813      *
1814      * @exception HDF5LibraryException
1815      *                - Error from the HDF-5 Library.
1816      **/
H5Dget_type(long dataset_id)1817     public static long H5Dget_type(long dataset_id) throws HDF5LibraryException {
1818         long id = _H5Dget_type(dataset_id);
1819         if (id > 0) {
1820             log.trace("OPEN_IDS: H5Dget_type add {}", id);
1821             OPEN_IDS.add(id);
1822             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
1823         }
1824         return id;
1825     }
1826 
_H5Dget_type(long dataset_id)1827     private synchronized static native long _H5Dget_type(long dataset_id) throws HDF5LibraryException;
1828 
1829     /**
1830      * H5Diterate iterates over all the data elements in the memory buffer buf, executing the callback function operator
1831      * once for each such data element.
1832      *
1833      * @param buf
1834      *            IN/OUT: Pointer to the memory containing the elements to iterate over.
1835      * @param buf_type
1836      *            IN: Buffer datatype identifier.
1837      * @param space_id
1838      *            IN: Dataspace describing memory buffer.
1839      * @param op
1840      *            IN: Callback function to operate on each value.
1841      * @param op_data
1842      *            IN/OUT: Pointer to any user-efined data for use by operator function.
1843      *
1844      * @return returns the return value of the first operator that returns a positive value, or zero if all members were
1845      *         processed with no operator returning non-zero.
1846      *
1847      * @exception HDF5LibraryException
1848      *                - Error from the HDF-5 Library.
1849      * @exception NullPointerException
1850      *                - buf is null.
1851      **/
H5Diterate(byte[] buf, long buf_type, long space_id, H5D_iterate_cb op, H5D_iterate_t op_data)1852     public synchronized static native int H5Diterate(byte[] buf, long buf_type, long space_id, H5D_iterate_cb op,
1853             H5D_iterate_t op_data) throws HDF5LibraryException, NullPointerException;
1854 
1855     /**
1856      * H5Dopen opens the existing dataset specified by a location identifier and name, loc_id and name, respectively.
1857      *
1858      * @param loc_id
1859      *            IN: Location identifier
1860      * @param name
1861      *            IN: Dataset name
1862      * @param dapl_id
1863      *            IN: Identifier of dataset access property list.
1864      *
1865      * @return a dataset identifier if successful
1866      *
1867      * @exception HDF5LibraryException
1868      *                - Error from the HDF-5 Library.
1869      * @exception NullPointerException
1870      *                - name is null.
1871      **/
H5Dopen(long loc_id, String name, long dapl_id)1872     public static long H5Dopen(long loc_id, String name, long dapl_id) throws HDF5LibraryException,  NullPointerException
1873     {
1874         long id = _H5Dopen2(loc_id, name, dapl_id);
1875         if (id > 0) {
1876             log.trace("OPEN_IDS: H5Dopen add {}", id);
1877             OPEN_IDS.add(id);
1878             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
1879         }
1880         return id;
1881     }
1882 
1883     /**
1884      * H5Dopen2 opens the existing dataset specified by a location identifier and name, loc_id and name, respectively.
1885      *
1886      * @see public static int H5Dopen(int loc_id, String name, int dapl_id)
1887      **/
_H5Dopen2(long loc_id, String name, long dapl_id)1888     private synchronized static native long _H5Dopen2(long loc_id, String name, long dapl_id)
1889             throws HDF5LibraryException, NullPointerException;
1890 
1891     /**
1892      * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
1893      * memory buffer buf.
1894      *
1895      * @param dataset_id
1896      *            Identifier of the dataset read from.
1897      * @param mem_type_id
1898      *            Identifier of the memory datatype.
1899      * @param mem_space_id
1900      *            Identifier of the memory dataspace.
1901      * @param file_space_id
1902      *            Identifier of the dataset's dataspace in the file.
1903      * @param xfer_plist_id
1904      *            Identifier of a transfer property list for this I/O operation.
1905      * @param obj
1906      *            Buffer to store data read from the file.
1907      * @param isCriticalPinning
1908      *            request lock on data reference.
1909      *
1910      * @return a non-negative value if successful
1911      *
1912      * @exception HDF5LibraryException
1913      *                - Error from the HDF-5 Library.
1914      * @exception NullPointerException
1915      *                - data buffer is null.
1916      **/
H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, byte[] obj, boolean isCriticalPinning)1917     public synchronized static native int H5Dread(long dataset_id, long mem_type_id, long mem_space_id,
1918             long file_space_id, long xfer_plist_id, byte[] obj, boolean isCriticalPinning) throws HDF5LibraryException,
1919             NullPointerException;
1920 
H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, byte[] buf)1921     public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id,
1922             long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException
1923     {
1924         return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
1925     }
1926 
H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object obj)1927     public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id,
1928             long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException
1929     {
1930         return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, obj, true);
1931     }
1932 
1933     /**
1934      * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
1935      * data object.
1936      *
1937      * @param dataset_id
1938      *            Identifier of the dataset read from.
1939      * @param mem_type_id
1940      *            Identifier of the memory datatype.
1941      * @param mem_space_id
1942      *            Identifier of the memory dataspace.
1943      * @param file_space_id
1944      *            Identifier of the dataset's dataspace in the file.
1945      * @param xfer_plist_id
1946      *            Identifier of a transfer property list for this I/O operation.
1947      * @param obj
1948      *            Object to store data read from the file.
1949      * @param isCriticalPinning
1950      *            request lock on data reference.
1951      *
1952      * @return a non-negative value if successful
1953      *
1954      * @exception HDF5Exception
1955      *                - Failure in the data conversion.
1956      * @exception HDF5LibraryException
1957      *                - Error from the HDF-5 Library.
1958      * @exception NullPointerException
1959      *                - data object is null.
1960      **/
H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object obj, boolean isCriticalPinning)1961     public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id,
1962             long xfer_plist_id, Object obj, boolean isCriticalPinning) throws HDF5Exception, HDF5LibraryException,
1963             NullPointerException
1964     {
1965         int status = -1;
1966         boolean is1D = false;
1967 
1968         Class dataClass = obj.getClass();
1969         if (!dataClass.isArray()) {
1970             throw (new HDF5JavaException("H5Dread: data is not an array"));
1971         }
1972 
1973         String cname = dataClass.getName();
1974         is1D = (cname.lastIndexOf('[') == cname.indexOf('['));
1975         char dname = cname.charAt(cname.lastIndexOf("[") + 1);
1976         log.trace("H5Dread: cname={} is1D={} dname={}", cname, is1D, dname);
1977 
1978         if (is1D && (dname == 'B')) {
1979             log.trace("H5Dread_dname_B");
1980             status = H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (byte[]) obj,
1981                     isCriticalPinning);
1982         }
1983         else if (is1D && (dname == 'S')) {
1984             log.trace("H5Dread_dname_S");
1985             status = H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (short[]) obj,
1986                     isCriticalPinning);
1987         }
1988         else if (is1D && (dname == 'I')) {
1989             log.trace("H5Dread_dname_I");
1990             status = H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (int[]) obj,
1991                     isCriticalPinning);
1992         }
1993         else if (is1D && (dname == 'J')) {
1994             log.trace("H5Dread_dname_J");
1995             status = H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (long[]) obj,
1996                     isCriticalPinning);
1997         }
1998         else if (is1D && (dname == 'F')) {
1999             log.trace("H5Dread_dname_F");
2000             status = H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (float[]) obj,
2001                     isCriticalPinning);
2002         }
2003         else if (is1D && (dname == 'D')) {
2004             log.trace("H5Dread_dname_D");
2005             status = H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
2006                     (double[]) obj, isCriticalPinning);
2007         }
2008         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)) {
2009             log.trace("H5Dread_reg_ref");
2010             status = H5Dread_reg_ref(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
2011                     (String[]) obj);
2012         }
2013         else if (is1D && (dataClass.getComponentType() == String.class)) {
2014             log.trace("H5Dread_string type");
2015             status = H5Dread_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
2016                         (String[]) obj);
2017         }
2018         else {
2019             // Create a data buffer to hold the data into a Java Array
2020             HDFArray theArray = new HDFArray(obj);
2021             byte[] buf = theArray.emptyBytes();
2022             log.trace("H5Dread_else");
2023 
2024             // will raise exception if read fails
2025             status = H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf,
2026                     isCriticalPinning);
2027             if (status >= 0) {
2028                 // convert the data into a Java Array
2029                 obj = theArray.arrayify(buf);
2030             }
2031 
2032             // clean up these: assign 'null' as hint to gc()
2033             buf = null;
2034             theArray = null;
2035         }
2036 
2037         return status;
2038     }
2039 
H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning)2040     public synchronized static native int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id,
2041             long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning)
2042                     throws HDF5LibraryException, NullPointerException;
2043 
H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, double[] buf)2044     public synchronized static int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id,
2045             long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException
2046     {
2047         return H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
2048     }
2049 
H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning)2050     public synchronized static native int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id,
2051             long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning)
2052                     throws HDF5LibraryException, NullPointerException;
2053 
H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, float[] buf)2054     public synchronized static int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id,
2055             long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException
2056     {
2057         return H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
2058     }
2059 
H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning)2060     public synchronized static native int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id,
2061             long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException,
2062             NullPointerException;
2063 
H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, int[] buf)2064     public synchronized static int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id,
2065             long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException
2066     {
2067         return H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
2068     }
2069 
H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning)2070     public synchronized static native int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id,
2071             long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException,
2072             NullPointerException;
2073 
H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, long[] buf)2074     public synchronized static int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id,
2075             long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException
2076     {
2077         return H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
2078     }
2079 
H5Dread_reg_ref(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf)2080     public synchronized static native int H5Dread_reg_ref(long dataset_id, long mem_type_id, long mem_space_id,
2081             long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException;
2082 
H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf, boolean isCriticalPinning)2083     public synchronized static native int H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id,
2084             long file_space_id, long xfer_plist_id, short[] buf, boolean isCriticalPinning)
2085                     throws HDF5LibraryException, NullPointerException;
2086 
H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf)2087     public synchronized static int H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id,
2088             long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException
2089     {
2090         return H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
2091     }
2092 
H5DreadVL(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf)2093     public synchronized static native int H5DreadVL(long dataset_id, long mem_type_id, long mem_space_id,
2094             long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException;
2095 
H5Dread_string(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf)2096     public synchronized static native int H5Dread_string(long dataset_id, long mem_type_id, long mem_space_id,
2097             long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException;
2098 
H5Dread_VLStrings(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf)2099     public synchronized static native int H5Dread_VLStrings(long dataset_id, long mem_type_id, long mem_space_id,
2100             long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException;
2101 
2102     /**
2103      * H5Dset_extent sets the current dimensions of the chunked dataset dset_id to the sizes specified in size.
2104      *
2105      * @param dset_id
2106      *            IN: Chunked dataset identifier.
2107      * @param size
2108      *            IN: Array containing the new magnitude of each dimension of the dataset.
2109      *
2110      * @exception HDF5LibraryException
2111      *                - Error from the HDF-5 Library.
2112      * @exception NullPointerException
2113      *                - size is null.
2114      **/
H5Dset_extent(long dset_id, long size[])2115     public synchronized static native void H5Dset_extent(long dset_id, long size[]) throws HDF5LibraryException,
2116     NullPointerException;
2117 
2118     /**
2119      * H5Dvlen_get_buf_size determines the number of bytes required to store the VL data from the dataset, using the
2120      * space_id for the selection in the dataset on disk and the type_id for the memory representation of the VL data in
2121      * memory.
2122      *
2123      * @param dset_id
2124      *            IN: Identifier of the dataset read from.
2125      * @param type_id
2126      *            IN: Identifier of the datatype.
2127      * @param space_id
2128      *            IN: Identifier of the dataspace.
2129      *
2130      * @return the size in bytes of the memory buffer required to store the VL data.
2131      *
2132      * @exception HDF5LibraryException
2133      *                - Error from the HDF-5 Library.
2134      * @exception NullPointerException
2135      *                - buf is null.
2136      **/
H5Dvlen_get_buf_size(long dset_id, long type_id, long space_id)2137     public synchronized static native long H5Dvlen_get_buf_size(long dset_id, long type_id, long space_id)
2138             throws HDF5LibraryException;
2139 
2140     /**
2141      * H5Dvlen_reclaim reclaims buffer used for VL data.
2142      *
2143      * @param type_id
2144      *            Identifier of the datatype.
2145      * @param space_id
2146      *            Identifier of the dataspace.
2147      * @param xfer_plist_id
2148      *            Identifier of a transfer property list for this I/O operation.
2149      * @param buf
2150      *            Buffer with data to be reclaimed.
2151      *
2152      * @return a non-negative value if successful
2153      *
2154      * @exception HDF5LibraryException
2155      *                - Error from the HDF-5 Library.
2156      * @exception NullPointerException
2157      *                - buf is null.
2158      **/
H5Dvlen_reclaim(long type_id, long space_id, long xfer_plist_id, byte[] buf)2159     public synchronized static native int H5Dvlen_reclaim(long type_id, long space_id, long xfer_plist_id, byte[] buf)
2160             throws HDF5LibraryException, NullPointerException;
2161 
2162     /**
2163      * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
2164      * buf into the file.
2165      *
2166      * @param dataset_id
2167      *            Identifier of the dataset read from.
2168      * @param mem_type_id
2169      *            Identifier of the memory datatype.
2170      * @param mem_space_id
2171      *            Identifier of the memory dataspace.
2172      * @param file_space_id
2173      *            Identifier of the dataset's dataspace in the file.
2174      * @param xfer_plist_id
2175      *            Identifier of a transfer property list for this I/O operation.
2176      * @param buf
2177      *            Buffer with data to be written to the file.
2178      * @param isCriticalPinning
2179      *            request lock on data reference.
2180      *
2181      * @return a non-negative value if successful
2182      *
2183      * @exception HDF5LibraryException
2184      *                - Error from the HDF-5 Library.
2185      * @exception NullPointerException
2186      *                - name is null.
2187      **/
H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, byte[] buf, boolean isCriticalPinning)2188     public synchronized static native int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id,
2189             long file_space_id, long xfer_plist_id, byte[] buf, boolean isCriticalPinning) throws HDF5LibraryException,
2190             NullPointerException;
2191 
H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, byte[] buf)2192     public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id,
2193             long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException
2194     {
2195         return H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
2196     }
2197 
H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object obj)2198     public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id,
2199             long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException
2200     {
2201         return H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, obj, true);
2202     }
2203 
2204     /**
2205      * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory data
2206      * object into the file.
2207      *
2208      * @param dataset_id
2209      *            Identifier of the dataset read from.
2210      * @param mem_type_id
2211      *            Identifier of the memory datatype.
2212      * @param mem_space_id
2213      *            Identifier of the memory dataspace.
2214      * @param file_space_id
2215      *            Identifier of the dataset's dataspace in the file.
2216      * @param xfer_plist_id
2217      *            Identifier of a transfer property list for this I/O operation.
2218      * @param obj
2219      *            Object with data to be written to the file.
2220      * @param isCriticalPinning
2221      *            request lock on data reference.
2222      *
2223      * @return a non-negative value if successful
2224      *
2225      * @exception HDF5Exception
2226      *                - Failure in the data conversion.
2227      * @exception HDF5LibraryException
2228      *                - Error from the HDF-5 Library.
2229      * @exception NullPointerException
2230      *                - data object is null.
2231      **/
H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object obj, boolean isCriticalPinning)2232     public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id,
2233             long xfer_plist_id, Object obj, boolean isCriticalPinning) throws HDF5Exception, HDF5LibraryException,
2234             NullPointerException
2235     {
2236         int status = -1;
2237         boolean is1D = false;
2238 
2239         Class dataClass = obj.getClass();
2240         if (!dataClass.isArray()) {
2241             throw (new HDF5JavaException("H5Dwrite: data is not an array"));
2242         }
2243 
2244         String cname = dataClass.getName();
2245         is1D = (cname.lastIndexOf('[') == cname.indexOf('['));
2246         char dname = cname.charAt(cname.lastIndexOf("[") + 1);
2247 
2248         if (is1D && (dname == 'B')) {
2249             status = H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (byte[]) obj,
2250                     isCriticalPinning);
2251         }
2252         else if (is1D && (dname == 'S')) {
2253             status = H5Dwrite_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (short[]) obj,
2254                     isCriticalPinning);
2255         }
2256         else if (is1D && (dname == 'I')) {
2257             status = H5Dwrite_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (int[]) obj,
2258                     isCriticalPinning);
2259         }
2260         else if (is1D && (dname == 'J')) {
2261             status = H5Dwrite_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (long[]) obj,
2262                     isCriticalPinning);
2263         }
2264         else if (is1D && (dname == 'F')) {
2265             status = H5Dwrite_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (float[]) obj,
2266                     isCriticalPinning);
2267         }
2268         else if (is1D && (dname == 'D')) {
2269             status = H5Dwrite_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
2270                     (double[]) obj, isCriticalPinning);
2271         }
2272         else if (is1D && (dataClass.getComponentType() == String.class)) {
2273             log.trace("H5Dwrite_string type");
2274             status = H5Dwrite_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
2275                         (String[]) obj);
2276         }
2277         else {
2278             HDFArray theArray = new HDFArray(obj);
2279             byte[] buf = theArray.byteify();
2280 
2281             // will raise exception on error
2282             status = H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf,
2283                     isCriticalPinning);
2284 
2285             // clean up these: assign 'null' as hint to gc()
2286             buf = null;
2287             theArray = null;
2288         }
2289 
2290         return status;
2291     }
2292 
H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning)2293     public synchronized static native int H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id,
2294             long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning)
2295                     throws HDF5LibraryException, NullPointerException;
2296 
H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, double[] buf)2297     public synchronized static int H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id,
2298             long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException
2299     {
2300         return H5Dwrite_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
2301     }
2302 
H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning)2303     public synchronized static native int H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id,
2304             long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning)
2305                     throws HDF5LibraryException, NullPointerException;
2306 
H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, float[] buf)2307     public synchronized static int H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id,
2308             long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException
2309     {
2310         return H5Dwrite_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
2311     }
2312 
H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning)2313     public synchronized static native int H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id,
2314             long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException,
2315             NullPointerException;
2316 
H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, int[] buf)2317     public synchronized static int H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id,
2318             long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException
2319     {
2320         return H5Dwrite_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
2321     }
2322 
H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning)2323     public synchronized static native int H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id,
2324             long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException,
2325             NullPointerException;
2326 
H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, long[] buf)2327     public synchronized static int H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id,
2328             long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException
2329     {
2330         return H5Dwrite_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
2331     }
2332 
H5Dwrite_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf, boolean isCriticalPinning)2333     public synchronized static native int H5Dwrite_short(long dataset_id, long mem_type_id, long mem_space_id,
2334             long file_space_id, long xfer_plist_id, short[] buf, boolean isCriticalPinning)
2335                     throws HDF5LibraryException, NullPointerException;
2336 
H5Dwrite_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf)2337     public synchronized static int H5Dwrite_short(long dataset_id, long mem_type_id, long mem_space_id,
2338             long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException
2339     {
2340         return H5Dwrite_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
2341     }
2342 
H5Dwrite_string(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf)2343     public synchronized static native int H5Dwrite_string(long dataset_id, long mem_type_id, long mem_space_id,
2344             long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException;
2345 
H5DwriteVL(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf)2346     public synchronized static native int H5DwriteVL(long dataset_id, long mem_type_id, long mem_space_id,
2347             long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException;
2348 
2349     /**
2350      * H5Dwrite_VLStrings writes a (partial) variable length String dataset, specified by its identifier dataset_id, from
2351      * the application memory buffer buf into the file.
2352      *
2353      * ---- contributed by Rosetta Biosoftware
2354      *
2355      * @param dataset_id
2356      *            Identifier of the dataset read from.
2357      * @param mem_type_id
2358      *            Identifier of the memory datatype.
2359      * @param mem_space_id
2360      *            Identifier of the memory dataspace.
2361      * @param file_space_id
2362      *            Identifier of the dataset's dataspace in the file.
2363      * @param xfer_plist_id
2364      *            Identifier of a transfer property list for this I/O operation.
2365      * @param buf
2366      *            Buffer with data to be written to the file.
2367      *
2368      * @return a non-negative value if successful
2369      *
2370      * @exception HDF5LibraryException
2371      *                - Error from the HDF-5 Library.
2372      * @exception NullPointerException
2373      *                - name is null.
2374      **/
2375 
H5Dwrite_VLStrings(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf)2376     public synchronized static native int H5Dwrite_VLStrings(long dataset_id, long mem_type_id, long mem_space_id,
2377             long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException;
2378 
2379     /**
2380      * H5Dflush causes all buffers associated with a dataset to be immediately flushed to disk without removing the
2381      * data from the cache.
2382      *
2383      * @param dset_id
2384      *            IN: Identifier of the dataset to be flushed.
2385      *
2386      * @exception HDF5LibraryException
2387      *                - Error from the HDF-5 Library.
2388      **/
H5Dflush(long dset_id)2389     public synchronized static native void H5Dflush(long dset_id) throws HDF5LibraryException;
2390 
2391     /**
2392      * H5Drefresh causes all buffers associated with a dataset to be cleared and immediately re-loaded with updated
2393      * contents from disk. This function essentially closes the dataset, evicts all metadata associated with it
2394      * from the cache, and then re-opens the dataset. The reopened dataset is automatically re-registered with the same ID.
2395      *
2396      * @param dset_id
2397      *            IN: Identifier of the dataset to be refreshed.
2398      *
2399      * @exception HDF5LibraryException
2400      *                - Error from the HDF-5 Library.
2401      **/
H5Drefresh(long dset_id)2402     public synchronized static native void H5Drefresh(long dset_id) throws HDF5LibraryException;
2403 
2404     // /////// unimplemented ////////
2405     //  herr_t H5Ddebug(hid_t dset_id);
2406     //  herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes);
2407     //  herr_t H5Dformat_convert(hid_t dset_id);
2408     //  herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type);
2409 
2410     // herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id,
2411     //                  size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data);
2412     // herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id, void *dst_buf);
2413 
2414     // ////////////////////////////////////////////////////////////
2415     // //
2416     // H5E: Error Stack //
2417     // //
2418     // ////////////////////////////////////////////////////////////
2419 
2420     /**
2421      * H5Eauto_is_v2 determines whether the error auto reporting function for an error stack conforms to the H5E_auto2_t
2422      * typedef or the H5E_auto1_t typedef.
2423      *
2424      * @param stack_id
2425      *            IN: Error stack identifier.
2426      *
2427      * @return boolean true if the error stack conforms to H5E_auto2_t and false if it conforms to H5E_auto1_t.
2428      *
2429      * @exception HDF5LibraryException
2430      *                - Error from the HDF-5 Library.
2431      **/
H5Eauto_is_v2(long stack_id)2432     public synchronized static native boolean H5Eauto_is_v2(long stack_id) throws HDF5LibraryException;
2433 
2434     /**
2435      * H5Eclear clears the error stack for the current thread. H5Eclear can fail if there are problems initializing the
2436      * library.
2437      * <p>
2438      * This may be used by exception handlers to assure that the error condition in the HDF-5 library has been reset.
2439      *
2440      * @return Returns a non-negative value if successful
2441      *
2442      * @exception HDF5LibraryException
2443      *                - Error from the HDF-5 Library.
2444      **/
H5Eclear()2445     public static int H5Eclear() throws HDF5LibraryException {
2446         H5Eclear2(HDF5Constants.H5E_DEFAULT);
2447         return 0;
2448     }
2449 
2450     /**
2451      * H5Eclear clears the error stack specified by estack_id, or, if estack_id is set to H5E_DEFAULT, the error stack
2452      * for the current thread.
2453      *
2454      * @param stack_id
2455      *            IN: Error stack identifier.
2456      *
2457      * @exception HDF5LibraryException
2458      *                - Error from the HDF-5 Library.
2459      **/
H5Eclear(long stack_id)2460     public static void H5Eclear(long stack_id) throws HDF5LibraryException {
2461         H5Eclear2(stack_id);
2462     }
2463 
2464     /**
2465      * H5Eclear2 clears the error stack specified by estack_id, or, if estack_id is set to H5E_DEFAULT, the error stack
2466      * for the current thread.
2467      *
2468      * @param stack_id
2469      *            IN: Error stack identifier.
2470      *
2471      * @exception HDF5LibraryException
2472      *                - Error from the HDF-5 Library.
2473      **/
H5Eclear2(long stack_id)2474     public synchronized static native void H5Eclear2(long stack_id) throws HDF5LibraryException;
2475 
2476     /**
2477      * H5Eclose_msg closes an error message identifier, which can be either a major or minor message.
2478      *
2479      * @param err_id
2480      *            IN: Error message identifier.
2481      *
2482      * @exception HDF5LibraryException
2483      *                - Error from the HDF-5 Library.
2484      **/
H5Eclose_msg(long err_id)2485     public synchronized static native void H5Eclose_msg(long err_id) throws HDF5LibraryException;
2486 
2487     /**
2488      * H5Eclose_stack closes the object handle for an error stack and releases its resources.
2489      *
2490      * @param stack_id
2491      *            IN: Error stack identifier.
2492      *
2493      * @exception HDF5LibraryException
2494      *                - Error from the HDF-5 Library.
2495      **/
H5Eclose_stack(long stack_id)2496     public synchronized static native void H5Eclose_stack(long stack_id) throws HDF5LibraryException;
2497 
2498     /**
2499      * H5Ecreate_msg adds an error message to an error class defined by client library or application program.
2500      *
2501      * @param cls_id
2502      *            IN: Error class identifier.
2503      * @param msg_type
2504      *            IN: The type of the error message.
2505      * @param msg
2506      *            IN: The error message.
2507      *
2508      * @return a message identifier
2509      *
2510      * @exception HDF5LibraryException
2511      *                - Error from the HDF-5 Library.
2512      * @exception NullPointerException
2513      *                - msg is null.
2514      **/
H5Ecreate_msg(long cls_id, int msg_type, String msg)2515     public synchronized static native long H5Ecreate_msg(long cls_id, int msg_type, String msg)
2516             throws HDF5LibraryException, NullPointerException;
2517 
2518     /**
2519      * H5Ecreate_stack creates a new empty error stack and returns the new stack's identifier.
2520      *
2521      * @return an error stack identifier
2522      *
2523      * @exception HDF5LibraryException
2524      *                - Error from the HDF-5 Library.
2525      **/
H5Ecreate_stack()2526     public synchronized static native long H5Ecreate_stack() throws HDF5LibraryException;
2527 
2528     /**
2529      * H5Eget_class_name retrieves the name of the error class specified by the class identifier.
2530      *
2531      * @param class_id
2532      *            IN: Error class identifier.
2533      *
2534      * @return the name of the error class
2535      *
2536      * @exception HDF5LibraryException
2537      *                - Error from the HDF-5 Library.
2538      **/
H5Eget_class_name(long class_id)2539     public synchronized static native String H5Eget_class_name(long class_id)
2540             throws HDF5LibraryException, NullPointerException;
2541 
2542     /**
2543      * H5Eget_current_stack copies the current error stack and returns an error stack identifier for the new copy.
2544      *
2545      * @return an error stack identifier
2546      *
2547      * @exception HDF5LibraryException
2548      *                - Error from the HDF-5 Library.
2549      **/
H5Eget_current_stack()2550     public synchronized static native long H5Eget_current_stack() throws HDF5LibraryException;
2551 
2552     /**
2553      * H5Eset_current_stack replaces the content of the current error stack with a copy of the content of the error
2554      * stack specified by estack_id.
2555      *
2556      * @param stack_id
2557      *            IN: Error stack identifier.
2558      *
2559      * @exception HDF5LibraryException
2560      *                - Error from the HDF-5 Library.
2561      **/
H5Eset_current_stack(long stack_id)2562     public synchronized static native void H5Eset_current_stack(long stack_id) throws HDF5LibraryException;
2563 
2564     /**
2565      * H5Eget_msg retrieves the error message including its length and type.
2566      *
2567      * @param msg_id
2568      *            IN: Name of the error class.
2569      * @param type_list
2570      *            OUT: The type of the error message. Valid values are H5E_MAJOR and H5E_MINOR.
2571      *
2572      * @return the error message
2573      *
2574      * @exception HDF5LibraryException
2575      *                - Error from the HDF-5 Library.
2576      **/
H5Eget_msg(long msg_id, int[] type_list)2577     public synchronized static native String H5Eget_msg(long msg_id, int[] type_list) throws HDF5LibraryException;
2578 
2579     /**
2580      * H5Eget_num retrieves the number of error records in the error stack specified by estack_id (including major,
2581      * minor messages and description).
2582      *
2583      * @param stack_id
2584      *            IN: Error stack identifier.
2585      *
2586      * @return the number of error messages
2587      *
2588      * @exception HDF5LibraryException
2589      *                - Error from the HDF-5 Library.
2590      **/
H5Eget_num(long stack_id)2591     public synchronized static native long H5Eget_num(long stack_id) throws HDF5LibraryException, NullPointerException;
2592 
2593     /**
2594      * H5Eprint2 prints the error stack specified by estack_id on the specified stream, stream.
2595      *
2596      * @param stack_id
2597      *            IN: Error stack identifier.If the identifier is H5E_DEFAULT, the current error stack will be printed.
2598      * @param stream
2599      *            IN: File pointer, or stderr if null.
2600      *
2601      * @exception HDF5LibraryException
2602      *                - Error from the HDF-5 Library.
2603      **/
H5Eprint2(long stack_id, Object stream)2604     public synchronized static native void H5Eprint2(long stack_id, Object stream) throws HDF5LibraryException;
2605 
2606     /**
2607      * H5Epop deletes the number of error records specified in count from the top of the error stack specified by
2608      * estack_id (including major, minor messages and description).
2609      *
2610      * @param stack_id
2611      *            IN: Error stack identifier.
2612      * @param count
2613      *            IN: Version of the client library or application to which the error class belongs.
2614      *
2615      * @exception HDF5LibraryException
2616      *                - Error from the HDF-5 Library.
2617      **/
H5Epop(long stack_id, long count)2618     public synchronized static native void H5Epop(long stack_id, long count) throws HDF5LibraryException;
2619 
2620 
2621     /**
2622      * H5Epush2 pushes a new error record onto the error stack specified by estack_id.
2623      *
2624      * @param stack_id
2625      *            IN: Error stack identifier.
2626      * @param file
2627      *            IN: Name of the file in which the error was detected.
2628      * @param func
2629      *            IN: Name of the function in which the error was detected.
2630      * @param line
2631      *            IN: Line number within the file at which the error was detected.
2632      * @param cls_id
2633      *            IN: Error class identifier.
2634      * @param maj_id
2635      *            IN: Major error identifier.
2636      * @param min_id
2637      *            IN: Minor error identifier.
2638      * @param msg
2639      *            IN: Error description string.
2640      *
2641      * @exception HDF5LibraryException
2642      *                - Error from the HDF-5 Library.
2643      * @exception NullPointerException
2644      *                - file, func, or msg is null.
2645       **/
H5Epush(long stack_id, String file, String func, int line, long cls_id, long maj_id, long min_id, String msg)2646     public static void H5Epush(long stack_id, String file, String func, int line,
2647                 long cls_id, long maj_id, long min_id, String msg) throws HDF5LibraryException, NullPointerException
2648     {
2649              H5Epush2(stack_id, file, func, line, cls_id, maj_id, min_id, msg);
2650     }
H5Epush2(long stack_id, String file, String func, int line, long cls_id, long maj_id, long min_id, String msg)2651     public synchronized static native void H5Epush2(long stack_id, String file, String func, int line,
2652                 long cls_id, long maj_id, long min_id, String msg) throws HDF5LibraryException, NullPointerException;
2653 
2654     /**
2655      * H5Eregister_class registers a client library or application program to the HDF5 error API so that the client
2656      * library or application program can report errors together with HDF5 library.
2657      *
2658      * @param cls_name
2659      *            IN: Name of the error class.
2660      * @param lib_name
2661      *            IN: Name of the client library or application to which the error class belongs.
2662      * @param version
2663      *            IN: Version of the client library or application to which the error class belongs.
2664      *
2665      * @return a class identifier
2666      *
2667      * @exception HDF5LibraryException
2668      *                - Error from the HDF-5 Library.
2669      * @exception NullPointerException
2670      *                - name is null.
2671      **/
H5Eregister_class(String cls_name, String lib_name, String version)2672     public synchronized static native long H5Eregister_class(String cls_name, String lib_name, String version)
2673             throws HDF5LibraryException, NullPointerException;
2674 
2675     /**
2676      * H5Eunregister_class removes the error class specified by class_id.
2677      *
2678      * @param class_id
2679      *            IN: Error class identifier.
2680      *
2681      * @exception HDF5LibraryException
2682      *                - Error from the HDF-5 Library.
2683      **/
H5Eunregister_class(long class_id)2684     public synchronized static native void H5Eunregister_class(long class_id) throws HDF5LibraryException;
2685 
2686     /**
2687      * H5Ewalk walks the error stack specified by estack_id for the current thread and calls the
2688      * function specified in func for each error along the way.
2689      *
2690      * @param stack_id
2691      *            IN: Error stack identifier.
2692      * @param direction
2693      *            IN: Direction in which the error stack is to be walked.
2694      * @param func
2695      *            IN: Function to be called for each error encountered.
2696      * @param client_data
2697      *            IN: Data to be passed with func.
2698      *
2699      * @exception HDF5LibraryException
2700      *                - Error from the HDF-5 Library.
2701      * @exception NullPointerException
2702      *                - func is null.
2703      **/
H5Ewalk(long stack_id, long direction, H5E_walk_cb func, H5E_walk_t client_data)2704     public static void H5Ewalk(long stack_id, long direction, H5E_walk_cb func, H5E_walk_t client_data) throws HDF5LibraryException, NullPointerException
2705     {
2706             H5Ewalk2(stack_id, direction, func, client_data);
2707     }
H5Ewalk2(long stack_id, long direction, H5E_walk_cb func, H5E_walk_t client_data)2708     public synchronized static native void H5Ewalk2(long stack_id, long direction, H5E_walk_cb func, H5E_walk_t client_data)
2709             throws HDF5LibraryException, NullPointerException;
2710 
2711     // /////// unimplemented ////////
2712     // public interface H5E_auto2_t extends Callback
2713     // {
2714     //         int callback(int estack, Pointer client_data);
2715     // }
2716 
2717     // int H5Eget_auto(long estack_id, H5E_auto2_t func, PointerByReference client_data);
2718     // {
2719     //         return H5Eget_auto2(estack_id, func, client_data);
2720     // }
2721     // int H5Eget_auto2(long estack_id, H5E_auto2_t func, PointerByReference client_data);
2722 
2723     // int H5Eset_auto(long estack_id, H5E_auto2_t func, Pointer client_data);
2724     // {
2725     //         return H5Eset_auto2(estack_id, func, client_data);
2726     // }
2727     // int H5Eset_auto2(long estack_id, H5E_auto2_t func, Pointer client_data);
2728 
2729     // public static void H5Epush(long err_stack, String file, String func, int line,
2730     //             long cls_id, long maj_id, long min_id, String msg, ...)
2731     // {
2732     //         H5Epush2(err_stack, file, func, line, cls_id, maj_id, min_id, msg, ...);
2733     // }
2734     // public synchronized static native void H5Epush2(long err_stack, String file, String func, int line,
2735     //             long cls_id, long maj_id, long min_id, String msg, ...);
2736 
2737     // ////////////////////////////////////////////////////////////
2738     // //
2739     // H5F: File Interface Functions //
2740     // //
2741     // ////////////////////////////////////////////////////////////
2742 
2743     /**
2744      * H5Fclose terminates access to an HDF5 file.
2745      *
2746      * @param file_id
2747      *            Identifier of a file to terminate access to.
2748      *
2749      * @return a non-negative value if successful
2750      *
2751      * @exception HDF5LibraryException
2752      *                - Error from the HDF-5 Library.
2753      **/
H5Fclose(long file_id)2754     public static int H5Fclose(long file_id) throws HDF5LibraryException {
2755         if (file_id < 0)
2756             return 0; // throw new HDF5LibraryException("Negative ID");;
2757 
2758         log.trace("OPEN_IDS: H5Fclose remove {}", file_id);
2759         OPEN_IDS.remove(file_id);
2760         log.trace("OPEN_IDS: {}", OPEN_IDS.size());
2761         return _H5Fclose(file_id);
2762     }
2763 
_H5Fclose(long file_id)2764     private synchronized static native int _H5Fclose(long file_id) throws HDF5LibraryException;
2765 
2766     /**
2767      * H5Fopen opens an existing file and is the primary function for accessing existing HDF5 files.
2768      *
2769      * @param name
2770      *            Name of the file to access.
2771      * @param flags
2772      *            File access flags.
2773      * @param access_id
2774      *            Identifier for the file access properties list.
2775      *
2776      * @return a file identifier if successful
2777      *
2778      * @exception HDF5LibraryException
2779      *                - Error from the HDF-5 Library.
2780      * @exception NullPointerException
2781      *                - name is null.
2782      **/
H5Fopen(String name, int flags, long access_id)2783     public static long H5Fopen(String name, int flags, long access_id) throws HDF5LibraryException,
2784             NullPointerException {
2785         long id = _H5Fopen(name, flags, access_id);
2786         if (id > 0) {
2787             log.trace("OPEN_IDS: H5Fopen add {}", id);
2788             OPEN_IDS.add(id);
2789             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
2790         }
2791         return id;
2792     }
2793 
_H5Fopen(String name, int flags, long access_id)2794     private synchronized static native long _H5Fopen(String name, int flags, long access_id)
2795             throws HDF5LibraryException, NullPointerException;
2796 
2797     /**
2798      * H5Freopen reopens an HDF5 file.
2799      *
2800      * @param file_id
2801      *            Identifier of a file to terminate and reopen access to.
2802      *
2803      * @exception HDF5LibraryException
2804      *                - Error from the HDF-5 Library.
2805      * @return a new file identifier if successful
2806      **/
H5Freopen(long file_id)2807     public static long H5Freopen(long file_id) throws HDF5LibraryException {
2808         long id = _H5Freopen(file_id);
2809         if (id > 0) {
2810             log.trace("OPEN_IDS: H5Freopen add {}", id);
2811             OPEN_IDS.add(id);
2812             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
2813         }
2814         return id;
2815     }
2816 
_H5Freopen(long file_id)2817     private synchronized static native long _H5Freopen(long file_id) throws HDF5LibraryException;
2818 
2819     /**
2820      * H5Fcreate is the primary function for creating HDF5 files.
2821      *
2822      * @param name
2823      *            Name of the file to access.
2824      * @param flags
2825      *            File access flags. Possible values include:
2826      *            <UL>
2827      *            <LI>
2828      *            H5F_ACC_RDWR Allow read and write access to file.</LI>
2829      *            <LI>
2830      *            H5F_ACC_RDONLY Allow read-only access to file.</LI>
2831      *            <LI>
2832      *            H5F_ACC_TRUNC Truncate file, if it already exists, erasing all data previously stored in the file.</LI>
2833      *            <LI>
2834      *            H5F_ACC_EXCL Fail if file already exists.</LI>
2835      *            <LI>
2836      *            H5P_DEFAULT Apply default file access and creation properties.</LI>
2837      *            </UL>
2838      *
2839      * @param create_id
2840      *            File creation property list identifier, used when modifying default file meta-data. Use H5P_DEFAULT
2841      *            for default access properties.
2842      * @param access_id
2843      *            File access property list identifier. If parallel file access is desired, this is a collective call
2844      *            according to the communicator stored in the access_id (not supported in Java). Use H5P_DEFAULT for
2845      *            default access properties.
2846      *
2847      * @return a file identifier if successful
2848      *
2849      * @exception HDF5LibraryException
2850      *                - Error from the HDF-5 Library.
2851      * @exception NullPointerException
2852      *                - name is null.
2853      **/
H5Fcreate(String name, int flags, long create_id, long access_id)2854     public static long H5Fcreate(String name, int flags, long create_id, long access_id) throws HDF5LibraryException,
2855             NullPointerException {
2856         long id = _H5Fcreate(name, flags, create_id, access_id);
2857         if (id > 0) {
2858             log.trace("OPEN_IDS: H5Fcreate add {}", id);
2859             OPEN_IDS.add(id);
2860             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
2861         }
2862         return id;
2863     }
2864 
_H5Fcreate(String name, int flags, long create_id, long access_id)2865     private synchronized static native long _H5Fcreate(String name, int flags, long create_id, long access_id)
2866             throws HDF5LibraryException, NullPointerException;
2867 
2868     /**
2869      * H5Fflush causes all buffers associated with a file or object to be immediately flushed (written) to disk without
2870      * removing the data from the (memory) cache.
2871      * <P>
2872      * After this call completes, the file (or object) is in a consistent state and all data written to date is assured
2873      * to be permanent.
2874      *
2875      * @param object_id
2876      *            Identifier of object used to identify the file. <b>object_id</b> can be any object associated with the
2877      *            file, including the file itself, a dataset, a group, an attribute, or a named data type.
2878      * @param scope
2879      *            specifies the scope of the flushing action, in the case that the HDF-5 file is not a single physical
2880      *            file.
2881      *            <P>
2882      *            Valid values are:
2883      *            <UL>
2884      *            <LI>
2885      *            H5F_SCOPE_GLOBAL Flushes the entire virtual file.</LI>
2886      *            <LI>
2887      *            H5F_SCOPE_LOCAL Flushes only the specified file.</LI>
2888      *            </UL>
2889      *
2890      * @return a non-negative value if successful
2891      *
2892      * @exception HDF5LibraryException
2893      *                - Error from the HDF-5 Library.
2894      **/
H5Fflush(long object_id, int scope)2895     public synchronized static native int H5Fflush(long object_id, int scope) throws HDF5LibraryException;
2896 
2897     /**
2898      * H5Fget_access_plist returns the file access property list identifier of the specified file.
2899      *
2900      * @param file_id
2901      *            Identifier of file to get access property list of
2902      *
2903      * @return a file access property list identifier if successful
2904      *
2905      * @exception HDF5LibraryException
2906      *                - Error from the HDF-5 Library.
2907      **/
H5Fget_access_plist(long file_id)2908     public static long H5Fget_access_plist(long file_id) throws HDF5LibraryException {
2909         long id = _H5Fget_access_plist(file_id);
2910         if (id > 0) {
2911             log.trace("OPEN_IDS: H5Fget_access_plist add {}", id);
2912             OPEN_IDS.add(id);
2913             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
2914         }
2915         return id;
2916     }
2917 
_H5Fget_access_plist(long file_id)2918     private synchronized static native long _H5Fget_access_plist(long file_id) throws HDF5LibraryException;
2919 
2920     /**
2921      * H5Fget_create_plist returns a file creation property list identifier identifying the creation properties used to
2922      * create this file.
2923      *
2924      * @param file_id
2925      *            Identifier of the file to get creation property list
2926      *
2927      * @return a file creation property list identifier if successful
2928      *
2929      * @exception HDF5LibraryException
2930      *                - Error from the HDF-5 Library.
2931      **/
H5Fget_create_plist(long file_id)2932     public static long H5Fget_create_plist(long file_id) throws HDF5LibraryException {
2933         long id = _H5Fget_create_plist(file_id);
2934         if (id > 0) {
2935             log.trace("OPEN_IDS: H5Fget_create_plist add {}", id);
2936             OPEN_IDS.add(id);
2937             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
2938         }
2939         return id;
2940     }
2941 
_H5Fget_create_plist(long file_id)2942     private synchronized static native long _H5Fget_create_plist(long file_id) throws HDF5LibraryException;
2943 
H5Fget_filesize(long file_id)2944     public synchronized static native long H5Fget_filesize(long file_id) throws HDF5LibraryException;
2945 
2946     /**
2947      * H5Fget_freespace returns the amount of space that is unused by any objects in the file.
2948      *
2949      * @param file_id
2950      *            IN: File identifier for a currently-open HDF5 file
2951      *
2952      * @return the amount of free space in the file
2953      *
2954      * @exception HDF5LibraryException
2955      *                - Error from the HDF-5 Library.
2956      **/
H5Fget_freespace(long file_id)2957     public synchronized static native long H5Fget_freespace(long file_id) throws HDF5LibraryException;
2958 
2959     /**
2960      * H5Fget_intent retrieves the intended access mode flag passed with H5Fopen when the file was opened.
2961      *
2962      * @param file_id
2963      *            IN: File identifier for a currently-open HDF5 file
2964      *
2965      * @return the intended access mode flag, as originally passed with H5Fopen.
2966      *
2967      * @exception HDF5LibraryException
2968      *                - Error from the HDF-5 Library.
2969      **/
H5Fget_intent(long file_id)2970     public synchronized static native int H5Fget_intent(long file_id) throws HDF5LibraryException;
2971 
2972     /**
2973      * H5Fget_mdc_hit_rate queries the metadata cache of the target file to obtain its hit rate (cache hits / (cache
2974      * hits + cache misses)) since the last time hit rate statistics were reset.
2975      *
2976      * @param file_id
2977      *            IN: Identifier of the target file.
2978      *
2979      * @return the double in which the hit rate is returned.
2980      *
2981      * @exception HDF5LibraryException
2982      *                - Error from the HDF-5 Library.
2983      **/
H5Fget_mdc_hit_rate(long file_id)2984     public synchronized static native double H5Fget_mdc_hit_rate(long file_id) throws HDF5LibraryException;
2985 
2986     /**
2987      * H5Fget_mdc_size queries the metadata cache of the target file for the desired size information.
2988      *
2989      * @param file_id
2990      *            IN: Identifier of the target file.
2991      * @param metadata_cache
2992      *            OUT: Current metadata cache information
2993      *            <ul>
2994      *            <li>metadata_cache[0] = max_size_ptr // current cache maximum size</li>
2995      *            <li>metadata_cache[1] = min_clean_size_ptr // current cache minimum clean size</li>
2996      *            <li>metadata_cache[2] = cur_size_ptr // current cache size</li>
2997      *            </ul>
2998      *
2999      * @return current number of entries in the cache
3000      *
3001      * @exception HDF5LibraryException
3002      *                - Error from the HDF-5 Library.
3003      * @exception NullPointerException
3004      *                - metadata_cache is null.
3005      **/
H5Fget_mdc_size(long file_id, long[] metadata_cache)3006     public synchronized static native int H5Fget_mdc_size(long file_id, long[] metadata_cache)
3007             throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
3008 
3009     /**
3010      * H5Fget_name retrieves the name of the file to which the object obj_id belongs.
3011      *
3012      * @param obj_id
3013      *            IN: Identifier of the object for which the associated filename is sought.
3014      *
3015      * @return the filename.
3016      *
3017      * @exception HDF5LibraryException
3018      *                - Error from the HDF-5 Library.
3019      **/
H5Fget_name(long obj_id)3020     public synchronized static native String H5Fget_name(long obj_id) throws HDF5LibraryException;
3021 
3022     /**
3023      * H5Fget_obj_count returns the number of open object identifiers for the file.
3024      *
3025      * @param file_id
3026      *            IN: File identifier for a currently-open HDF5 file
3027      * @param types
3028      *            IN: Type of object for which identifiers are to be returned.
3029      *            <ul>
3030      *            <li>H5F_OBJ_FILE Files only</li>
3031      *            <li>H5F_OBJ_DATASET Datasets only</li>
3032      *            <li>H5F_OBJ_GROUP Groups only</li>
3033      *            <li>H5F_OBJ_DATATYPE Named datatypes only</li>
3034      *            <li>H5F_OBJ_ATTR Attributes only</li>
3035      *            <li>H5F_OBJ_ALL All of the above</li>
3036      *            <li>H5F_OBJ_LOCAL Restrict search to objects opened through current file identifier.</li>
3037      *            </ul>
3038      *
3039      * @return the number of open objects.
3040      *
3041      * @exception HDF5LibraryException
3042      *                - Error from the HDF-5 Library.
3043      **/
H5Fget_obj_count(long file_id, int types)3044     public synchronized static native long H5Fget_obj_count(long file_id, int types) throws HDF5LibraryException;
3045 
3046     /**
3047      * H5Fget_obj_ids returns the list of identifiers for all open HDF5 objects fitting the specified criteria.
3048      *
3049      * @param file_id
3050      *            IN: File identifier for a currently-open HDF5 file
3051      * @param types
3052      *            IN: Type of object for which identifiers are to be returned.
3053      * @param max_objs
3054      *            IN: Maximum number of object identifiers to place into obj_id_list.
3055      * @param obj_id_list
3056      *            OUT: Pointer to the returned list of open object identifiers.
3057      *
3058      * @return the number of objects placed into obj_id_list.
3059      *
3060      * @exception HDF5LibraryException
3061      *                - Error from the HDF-5 Library.
3062      * @exception NullPointerException
3063      *                - obj_id_list is null.
3064      **/
H5Fget_obj_ids(long file_id, int types, long max_objs, long[] obj_id_list)3065     public synchronized static native long H5Fget_obj_ids(long file_id, int types, long max_objs, long[] obj_id_list)
3066             throws HDF5LibraryException, NullPointerException;
3067 
3068     /**
3069      * H5Fis_hdf5 determines whether a file is in the HDF5 format.
3070      *
3071      * @param name
3072      *            File name to check format.
3073      *
3074      * @return true if is HDF-5, false if not.
3075      *
3076      * @exception HDF5LibraryException
3077      *                - Error from the HDF-5 Library.
3078      * @exception NullPointerException
3079      *                - name is null.
3080      **/
H5Fis_hdf5(String name)3081     public synchronized static native boolean H5Fis_hdf5(String name) throws HDF5LibraryException, NullPointerException;
3082 
3083     /**
3084      * H5Fmount mounts the file specified by child_id onto the group specified by loc_id and name using the mount
3085      * properties plist_id.
3086      *
3087      * @param loc_id
3088      *            The identifier for the group onto which the file specified by child_id is to be mounted.
3089      * @param name
3090      *            The name of the group onto which the file specified by child_id is to be mounted.
3091      * @param child_id
3092      *            The identifier of the file to be mounted.
3093      * @param plist_id
3094      *            The identifier of the property list to be used.
3095      *
3096      * @return a non-negative value if successful
3097      *
3098      * @exception HDF5LibraryException
3099      *                - Error from the HDF-5 Library.
3100      * @exception NullPointerException
3101      *                - name is null.
3102      **/
H5Fmount(long loc_id, String name, long child_id, long plist_id)3103     public synchronized static native int H5Fmount(long loc_id, String name, long child_id, long plist_id)
3104             throws HDF5LibraryException, NullPointerException;
3105 
3106     /**
3107      * Given a mount point, H5Funmount dissassociates the mount point's file from the file mounted there.
3108      *
3109      * @param loc_id
3110      *            The identifier for the location at which the specified file is to be unmounted.
3111      * @param name
3112      *            The name of the file to be unmounted.
3113      *
3114      * @return a non-negative value if successful
3115      *
3116      * @exception HDF5LibraryException
3117      *                - Error from the HDF-5 Library.
3118      * @exception NullPointerException
3119      *                - name is null.
3120      **/
H5Funmount(long loc_id, String name)3121     public synchronized static native int H5Funmount(long loc_id, String name) throws HDF5LibraryException,
3122     NullPointerException;
3123 
3124     /**
3125      * H5Freset_mdc_hit_rate_stats resets the hit rate statistics counters in the metadata cache associated with the
3126      * specified file.
3127      *
3128      * @param file_id
3129      *            IN: Identifier of the target file.
3130      *
3131      * @exception HDF5LibraryException
3132      *                - Error from the HDF-5 Library.
3133      **/
H5Freset_mdc_hit_rate_stats(long file_id)3134     public synchronized static native void H5Freset_mdc_hit_rate_stats(long file_id) throws HDF5LibraryException;
3135 
3136     /**
3137      * H5Fget_info returns global information for the file associated with the
3138      * object identifier obj_id.
3139      *
3140      * @param obj_id IN: Object identifier for any object in the file.
3141      *
3142      * @return A buffer(H5F_info2_t) for current "global" information about file
3143      *
3144      * @exception HDF5LibraryException - Error from the HDF-5 Library.
3145      **/
H5Fget_info(long obj_id)3146     public synchronized static native H5F_info2_t H5Fget_info(long obj_id) throws HDF5LibraryException;
3147 
3148     /**
3149      * H5Fclear_elink_file_cache evicts all the cached child files in the specified file's external file
3150      * cache, causing them to be closed if there is nothing else holding them open.
3151      *
3152      * @param file_id
3153      *            IN: Identifier of the target file.
3154      *
3155      * @exception HDF5LibraryException
3156      *                - Error from the HDF-5 Library.
3157      **/
H5Fclear_elink_file_cache(long file_id)3158     public synchronized static native void H5Fclear_elink_file_cache(long file_id) throws HDF5LibraryException;
3159 
3160     /**
3161      * H5Fstart_swmr_write will activate SWMR writing mode for a file associated with file_id. This routine will
3162      * prepare and ensure the file is safe for SWMR writing.
3163      *
3164      * @param file_id
3165      *            IN: Identifier of the target file.
3166      *
3167      * @exception HDF5LibraryException
3168      *                - Error from the HDF-5 Library.
3169      **/
H5Fstart_swmr_write(long file_id)3170     public synchronized static native void H5Fstart_swmr_write(long file_id) throws HDF5LibraryException;
3171 
3172     /**
3173      * H5Fstart_mdc_logging starts logging metadata cache events if logging was previously enabled.
3174      *
3175      * @param file_id
3176      *            IN: Identifier of the target file.
3177      *
3178      * @exception HDF5LibraryException
3179      *                - Error from the HDF-5 Library.
3180      **/
H5Fstart_mdc_logging(long file_id)3181     public synchronized static native void H5Fstart_mdc_logging(long file_id) throws HDF5LibraryException;
3182 
3183     /**
3184      * H5Fstop_mdc_logging stops logging metadata cache events if logging was previously enabled and is currently ongoing.
3185      *
3186      * @param file_id
3187      *            IN: Identifier of the target file.
3188      *
3189      * @exception HDF5LibraryException
3190      *                - Error from the HDF-5 Library.
3191      **/
H5Fstop_mdc_logging(long file_id)3192     public synchronized static native void H5Fstop_mdc_logging(long file_id) throws HDF5LibraryException;
3193 
3194     /**
3195      * H5Fget_mdc_logging_status gets the current metadata cache logging status.
3196      *
3197      * @param file_id
3198      *            IN: Identifier of the target file.
3199      *
3200      * @param mdc_logging_status
3201      *          the status
3202      *             mdc_logging_status[0] = is_enabled, whether logging is enabled
3203      *             mdc_logging_status[1] = is_currently_logging, whether events are currently being logged
3204      *
3205      * @exception HDF5LibraryException
3206      *                - Error from the HDF-5 Library.
3207      * @exception NullPointerException
3208      *                - mdc_logging_status is null.
3209      **/
H5Fget_mdc_logging_status(long file_id, boolean[] mdc_logging_status)3210     public synchronized static native void H5Fget_mdc_logging_status(long file_id, boolean[] mdc_logging_status)
3211             throws HDF5LibraryException, NullPointerException;
3212 
3213     /**
3214      * H5Fget_dset_no_attrs_hint gets the file-level setting to create minimized dataset object headers.
3215      *
3216      * @param file_id
3217      *            IN: Identifier of the target file.
3218      *
3219      * @return true if the file-level is set to create minimized dataset object headers, false if not.
3220      *
3221      * @exception HDF5LibraryException
3222      *                - Error from the HDF-5 Library.
3223      **/
H5Fget_dset_no_attrs_hint(long file_id)3224     public synchronized static native boolean H5Fget_dset_no_attrs_hint(long file_id)
3225             throws HDF5LibraryException;
3226 
3227 
3228     /**
3229      * H5Fset_dset_no_attrs_hint sets the file-level setting to create minimized dataset object headers.
3230      *
3231      * @param file_id
3232      *            IN: Identifier of the target file.
3233      * @param minimize
3234      *          the minimize hint setting
3235      *
3236      * @exception HDF5LibraryException
3237      *                - Error from the HDF-5 Library.
3238      **/
H5Fset_dset_no_attrs_hint(long file_id, boolean minimize)3239     public synchronized static native void H5Fset_dset_no_attrs_hint(long file_id, boolean minimize)
3240             throws HDF5LibraryException;
3241 
3242 
3243     /**
3244      * H5Fset_libver_bounds sets a different low and high bounds while a file is open.
3245      *
3246      * @param file_id
3247      *            IN: Identifier of the target file.
3248      * @param low
3249      *            IN: The earliest version of the library that will be used for writing objects
3250      * @param high
3251      *            IN: The latest version of the library that will be used for writing objects.
3252      *
3253      * @exception HDF5LibraryException
3254      *                - Error from the HDF-5 Library.
3255      **/
H5Fset_libver_bounds(long file_id, int low, int high)3256     public synchronized static native void H5Fset_libver_bounds(long file_id, int low, int high)
3257             throws HDF5LibraryException;
3258 
3259     // /////// unimplemented ////////
3260     //  herr_t H5Fget_eoa(hid_t file_id, haddr_t *eoa);
3261     //  herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment);
3262     // ssize_t H5Fget_file_image(hid_t file_id, void * buf_ptr, size_t buf_len);
3263     // herr_t H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info);
3264     // ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/);
3265     //  herr_t H5Fformat_convert(hid_t fid);
3266     //  herr_t H5Freset_page_buffering_stats(hid_t file_id);
3267     //  herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2],
3268     //     unsigned hits[2], unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]);
3269     //  herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_size);
3270     // #ifdef H5_HAVE_PARALLEL
3271     //    herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag);
3272     //    herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag);
3273     // #endif /* H5_HAVE_PARALLEL */
3274 
3275     // /**
3276     // * H5Fget_vfd_handle returns a pointer to the file handle from the
3277     // low-level file driver
3278     // * currently being used by the HDF5 library for file I/O.
3279     // *
3280     // * @param file_id IN: Identifier of the file to be queried.
3281     // * @param fapl IN: File access property list identifier.
3282     // *
3283     // * @return a pointer to the file handle being used by the low-level
3284     // virtual file driver.
3285     // *
3286     // * @exception HDF5LibraryException - Error from the HDF-5 Library.
3287     // **/
3288     // public synchronized static native Pointer file_handle
3289     // H5Fget_vfd_handle(int file_id, int fapl)
3290     //             throws HDF5LibraryException;
3291 
3292     // /**
3293     // * H5Fget_mdc_config loads the current metadata cache configuration into
3294     // * the instance of H5AC_cache_config_t pointed to by the config_ptr
3295     // parameter.
3296     // *
3297     // * @param file_id IN: Identifier of the target file
3298     // * @param config_ptr IN/OUT: Pointer to the instance of
3299     // H5AC_cache_config_t in which the current metadata cache configuration is to be reported.
3300     // *
3301     // * @return none
3302     // *
3303     // * @exception HDF5LibraryException - Error from the HDF-5 Library.
3304     // * @exception NullPointerException - config_ptr is null.
3305     // **/
3306     // public synchronized static native void H5Fget_mdc_config(int file_id, H5AC_cache_config_t config_ptr)
3307     //             throws HDF5LibraryException, NullPointerException;
3308 
3309     // /**
3310     // * H5Fset_mdc_config attempts to configure the file's metadata cache
3311     // according to the configuration supplied.
3312     // *
3313     // * @param file_id IN: Identifier of the target file
3314     // * @param config_ptr IN: Pointer to the instance of H5AC_cache_config_t
3315     // containing the desired configuration.
3316     // *
3317     // * @return none
3318     // *
3319     // * @exception HDF5LibraryException - Error from the HDF-5 Library.
3320     // * @exception NullPointerException - config_ptr is null.
3321     // **/
3322     // public synchronized static native int H5Fset_mdc_config(int file_id, H5AC_cache_config_t config_ptr)
3323     //             throws HDF5LibraryException, NullPointerException;
3324 
3325     // ////////////////////////////////////////////////////////////
3326     // //
3327     // H5FD: File Driver Interface Functions //
3328     // //
3329     // ////////////////////////////////////////////////////////////
3330 
3331     // /////// unimplemented ////////
3332     //  hid_t H5FDregister(const H5FD_class_t *cls);
3333     //  herr_t H5FDunregister(hid_t driver_id);
3334     //  H5FD_t *H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
3335     //  herr_t H5FDclose(H5FD_t *file);
3336     //  int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2);
3337     //  int H5FDquery(const H5FD_t *f, unsigned long *flags);
3338     //  haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
3339     //  herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
3340     //  haddr_t H5FDget_eoa(H5FD_t *file, H5FD_mem_t type);
3341     //  herr_t H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t eoa);
3342     //  haddr_t H5FDget_eof(H5FD_t *file, H5FD_mem_t type);
3343     //  herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void**file_handle);
3344     //  herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/);
3345     //  herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf);
3346     //  herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
3347     //  herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
3348     //  herr_t H5FDlock(H5FD_t *file, hbool_t rw);
3349     //  herr_t H5FDunlock(H5FD_t *file);
3350     //  herr_t H5FDdriver_query(hid_t driver_id, unsigned long *flags/*out*/);
3351 
3352     // ////////////////////////////////////////////////////////////
3353     // //
3354     // H5FS: File Free Space Interface Functions //
3355     // //
3356     // ////////////////////////////////////////////////////////////
3357 
3358     // No public Functions
3359 
3360     // ////////////////////////////////////////////////////////////
3361     // //
3362     // H5G: Group Interface Functions //
3363     // //
3364     // ////////////////////////////////////////////////////////////
3365 
3366     /**
3367      * H5Gclose releases resources used by a group which was opened by a call to H5Gcreate() or H5Gopen().
3368      *
3369      * @param group_id
3370      *            Group identifier to release.
3371      *
3372      * @return a non-negative value if successful
3373      *
3374      * @exception HDF5LibraryException
3375      *                - Error from the HDF-5 Library.
3376      **/
H5Gclose(long group_id)3377     public static int H5Gclose(long group_id) throws HDF5LibraryException {
3378         if (group_id < 0)
3379             return 0; // throw new HDF5LibraryException("Negative ID");;
3380 
3381         log.trace("OPEN_IDS: H5Gclose remove {}", group_id);
3382         OPEN_IDS.remove(group_id);
3383         log.trace("OPEN_IDS: {}", OPEN_IDS.size());
3384         return _H5Gclose(group_id);
3385     }
3386 
_H5Gclose(long group_id)3387     private synchronized static native int _H5Gclose(long group_id) throws HDF5LibraryException;
3388 
3389     /**
3390      * H5Gcreate creates a new group with the specified name at the specified location, loc_id.
3391      *
3392      * @param loc_id
3393      *            IN: The file or group identifier.
3394      * @param name
3395      *            IN: The absolute or relative name of the new group.
3396      * @param lcpl_id
3397      *            IN: Identifier of link creation property list.
3398      * @param gcpl_id
3399      *            IN: Identifier of group creation property list.
3400      * @param gapl_id
3401      *            IN: Identifier of group access property list. (No group access properties have been implemented at
3402      *            this time; use H5P_DEFAULT.)
3403      *
3404      * @return a valid group identifier
3405      *
3406      * @exception HDF5LibraryException
3407      *                - Error from the HDF-5 Library.
3408      * @exception NullPointerException
3409      *                - name is null.
3410      **/
H5Gcreate(long loc_id, String name, long lcpl_id, long gcpl_id, long gapl_id)3411     public static long H5Gcreate(long loc_id, String name, long lcpl_id, long gcpl_id, long gapl_id)
3412             throws HDF5LibraryException, NullPointerException {
3413         long id = _H5Gcreate2(loc_id, name, lcpl_id, gcpl_id, gapl_id);
3414         if (id > 0) {
3415             log.trace("OPEN_IDS: H5Gcreate add {}", id);
3416             OPEN_IDS.add(id);
3417             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
3418         }
3419         return id;
3420     }
3421 
_H5Gcreate2(long loc_id, String name, long lcpl_id, long gcpl_id, long gapl_id)3422     private synchronized static native long _H5Gcreate2(long loc_id, String name, long lcpl_id, long gcpl_id,
3423             long gapl_id) throws HDF5LibraryException, NullPointerException;
3424 
3425     /**
3426      * H5Gcreate_anon creates a new empty group in the file specified by loc_id.
3427      *
3428      * @param loc_id
3429      *            IN: File or group identifier specifying the file in which the new group is to be created.
3430      * @param gcpl_id
3431      *            IN: Identifier of group creation property list.
3432      * @param gapl_id
3433      *            IN: Identifier of group access property list. (No group access properties have been implemented at
3434      *            this time; use H5P_DEFAULT.)
3435      *
3436      * @return a valid group identifier
3437      *
3438      * @exception HDF5LibraryException
3439      *                - Error from the HDF-5 Library.
3440      **/
H5Gcreate_anon(long loc_id, long gcpl_id, long gapl_id)3441     public static long H5Gcreate_anon(long loc_id, long gcpl_id, long gapl_id) throws HDF5LibraryException {
3442         long id = _H5Gcreate_anon(loc_id, gcpl_id, gapl_id);
3443         if (id > 0) {
3444             log.trace("OPEN_IDS: H5Gcreate_anon add {}", id);
3445             OPEN_IDS.add(id);
3446             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
3447         }
3448         return id;
3449     }
3450 
_H5Gcreate_anon(long loc_id, long gcpl_id, long gapl_id)3451     private synchronized static native long _H5Gcreate_anon(long loc_id, long gcpl_id, long gapl_id)
3452             throws HDF5LibraryException;
3453 
3454     /**
3455      * H5Gget_create_plist returns an identifier for the group creation property list associated with the group
3456      * specified by group_id.
3457      *
3458      * @param group_id
3459      *            IN: Identifier of the group.
3460      *
3461      * @return an identifier for the group's creation property list
3462      *
3463      * @exception HDF5LibraryException
3464      *                - Error from the HDF-5 Library.
3465      **/
H5Gget_create_plist(long group_id)3466     public synchronized static native long H5Gget_create_plist(long group_id) throws HDF5LibraryException;
3467 
3468     /**
3469      * H5Gget_info retrieves information about the group specified by group_id. The information is returned in the
3470      * group_info struct.
3471      *
3472      * @param group_id
3473      *            IN: Identifier of the group.
3474      *
3475      * @return a structure in which group information is returned
3476      *
3477      * @exception HDF5LibraryException
3478      *                - Error from the HDF-5 Library.
3479      **/
H5Gget_info(long group_id)3480     public synchronized static native H5G_info_t H5Gget_info(long group_id) throws HDF5LibraryException;
3481 
3482     /**
3483      * H5Gget_info_by_idx retrieves information about a group, according to the group's position within an index.
3484      *
3485      * @param group_id
3486      *            IN: File or group identifier.
3487      * @param group_name
3488      *            IN: Name of group for which information is to be retrieved.
3489      * @param idx_type
3490      *            IN: Type of index by which objects are ordered
3491      * @param order
3492      *            IN: Order of iteration within index
3493      * @param n
3494      *            IN: Attribute's position in index
3495      * @param lapl_id
3496      *            IN: Link access property list.
3497      *
3498      * @return a structure in which group information is returned
3499      *
3500      * @exception HDF5LibraryException
3501      *                - Error from the HDF-5 Library.
3502      * @exception NullPointerException
3503      *                - name is null.
3504      **/
H5Gget_info_by_idx(long group_id, String group_name, int idx_type, int order, long n, long lapl_id)3505     public synchronized static native H5G_info_t H5Gget_info_by_idx(long group_id, String group_name, int idx_type,
3506             int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException;
3507 
3508     /**
3509      * H5Gget_info_by_name retrieves information about the group group_name located in the file or group specified by
3510      * loc_id.
3511      *
3512      * @param group_id
3513      *            IN: File or group identifier.
3514      * @param name
3515      *            IN: Name of group for which information is to be retrieved.
3516      * @param lapl_id
3517      *            IN: Link access property list.
3518      *
3519      * @return a structure in which group information is returned
3520      *
3521      * @exception HDF5LibraryException
3522      *                - Error from the HDF-5 Library.
3523      * @exception NullPointerException
3524      *                - name is null.
3525      **/
H5Gget_info_by_name(long group_id, String name, long lapl_id)3526     public synchronized static native H5G_info_t H5Gget_info_by_name(long group_id, String name, long lapl_id)
3527             throws HDF5LibraryException, NullPointerException;
3528 
3529     /**
3530      * retrieves information of all objects under the group (name) located in the file or group specified by loc_id.
3531      *
3532      * @param loc_id
3533      *            IN: File or group identifier
3534      * @param name
3535      *            IN: Name of group for which information is to be retrieved
3536      * @param objNames
3537      *            OUT: Names of all objects under the group, name.
3538      * @param objTypes
3539      *            OUT: Types of all objects under the group, name.
3540      * @param objRef
3541      *            OUT: Reference number of all objects under the group, name.
3542      *
3543      * @return the number of items found
3544      *
3545      * @exception HDF5LibraryException
3546      *                - Error from the HDF-5 Library.
3547      * @exception NullPointerException
3548      *                - name is null.
3549      */
H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes, long[] objRef)3550     public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes,
3551             long[] objRef) throws HDF5LibraryException, NullPointerException {
3552         if (objNames == null) {
3553             throw new NullPointerException("H5Gget_obj_info_all(): name array is null");
3554         }
3555 
3556         return H5Gget_obj_info_all(loc_id, name, objNames, objTypes, null, null, objRef, HDF5Constants.H5_INDEX_NAME);
3557     }
3558 
H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype, int[] ltype, long[] ref, int indx_type)3559     public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype,
3560             int[] ltype, long[] ref, int indx_type) throws HDF5LibraryException, NullPointerException {
3561         return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, null, ref, indx_type, -1);
3562     }
3563 
H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype, int[] ltype, long[] fno, long[] ref, int indx_type)3564     public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype,
3565             int[] ltype, long[] fno, long[] ref, int indx_type) throws HDF5LibraryException, NullPointerException {
3566         return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, ref, oname.length, indx_type, -1);
3567     }
3568 
H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype, int[] ltype, long[] fno, long[] ref, int indx_type, int indx_order)3569     public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype,
3570             int[] ltype, long[] fno, long[] ref, int indx_type, int indx_order) throws HDF5LibraryException,
3571             NullPointerException {
3572         if (oname == null) {
3573             throw new NullPointerException("H5Gget_obj_info_full(): name array is null");
3574         }
3575 
3576         if (otype == null) {
3577             throw new NullPointerException("H5Gget_obj_info_full(): object type array is null");
3578         }
3579 
3580         if (oname.length == 0) {
3581             throw new HDF5LibraryException("H5Gget_obj_info_full(): array size is zero");
3582         }
3583 
3584         if (oname.length != otype.length) {
3585             throw new HDF5LibraryException("H5Gget_obj_info_full(): name and type array sizes are different");
3586         }
3587 
3588         if (ltype == null)
3589             ltype = new int[otype.length];
3590 
3591         if (fno == null)
3592             fno = new long[ref.length];
3593 
3594         if (indx_type < 0)
3595             indx_type = HDF5Constants.H5_INDEX_NAME;
3596 
3597         if (indx_order < 0)
3598             indx_order = HDF5Constants.H5_ITER_INC;
3599 
3600         log.trace("H5Gget_obj_info_full: oname_len={}", oname.length);
3601         int status = H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, ref, oname.length, indx_type,
3602                 indx_order);
3603         for (int indx = 0; indx < oname.length; indx++)
3604             log.trace("H5Gget_obj_info_full: oname={}", oname[indx]);
3605         return status;
3606     }
3607 
H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype, int[] ltype, long[] fno, long[] ref, int n, int indx_type, int indx_order)3608     private synchronized static native int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype,
3609             int[] ltype, long[] fno, long[] ref, int n, int indx_type, int indx_order) throws HDF5LibraryException,
3610             NullPointerException;
3611 
3612     /**
3613      * H5Gget_obj_info_idx report the name and type of object with index 'idx' in a Group. The 'idx' corresponds to the
3614      * index maintained by H5Giterate. Each link is returned, so objects with multiple links will be counted once for
3615      * each link.
3616      *
3617      * @param loc_id
3618      *            IN: file or group ID.
3619      * @param name
3620      *            IN: name of the group to iterate, relative to the loc_id
3621      * @param idx
3622      *            IN: the index of the object to iterate.
3623      * @param oname
3624      *            the name of the object [OUT]
3625      * @param type
3626      *            the type of the object [OUT]
3627      *
3628      * @return non-negative if successful, -1 if not.
3629      *
3630      * @exception HDF5LibraryException
3631      *                - Error from the HDF-5 Library.
3632      * @exception NullPointerException
3633      *                - name is null.
3634      */
H5Gget_obj_info_idx(long loc_id, String name, int idx, String[] oname, int[] type)3635     public synchronized static int H5Gget_obj_info_idx(long loc_id, String name, int idx, String[] oname, int[] type)
3636             throws HDF5LibraryException, NullPointerException {
3637         String n[] = new String[1];
3638         n[0] = new String("");
3639         oname[0] = H5Lget_name_by_idx(loc_id, name, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, idx,
3640                 HDF5Constants.H5P_DEFAULT);
3641         H5L_info_t info = H5Lget_info_by_idx(loc_id, name, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, idx,
3642                 HDF5Constants.H5P_DEFAULT);
3643         type[0] = info.type;
3644         return 0;
3645     }
3646 
3647     /*
3648      * Add these methods so that we don't need to call
3649      * in a loop to get information for all the object in a group, which takes
3650      * a lot of time to finish if the number of objects is more than 10,000
3651      */
3652     /**
3653      * retrieves information of all objects (recurvisely) under the group (name) located in the file or group specified
3654      * by loc_id upto maximum specified by objMax.
3655      *
3656      * @param loc_id
3657      *            IN: File or group identifier
3658      * @param objNames
3659      *            OUT: Names of all objects under the group, name.
3660      * @param objTypes
3661      *            OUT: Types of all objects under the group, name.
3662      * @param lnkTypes
3663      *            OUT: Types of all links under the group, name.
3664      * @param objRef
3665      *            OUT: Reference number of all objects under the group, name.
3666      * @param objMax
3667      *            IN: Maximum number of all objects under the group, name.
3668      *
3669      * @return the number of items found
3670      *
3671      * @exception HDF5LibraryException
3672      *                - Error from the HDF-5 Library.
3673      * @exception NullPointerException
3674      *                - name is null.
3675      */
H5Gget_obj_info_max(long loc_id, String[] objNames, int[] objTypes, int[] lnkTypes, long[] objRef, long objMax)3676     public synchronized static int H5Gget_obj_info_max(long loc_id, String[] objNames, int[] objTypes, int[] lnkTypes,
3677             long[] objRef, long objMax) throws HDF5LibraryException, NullPointerException {
3678         if (objNames == null) {
3679             throw new NullPointerException("H5Gget_obj_info_max(): name array is null");
3680         }
3681 
3682         if (objTypes == null) {
3683             throw new NullPointerException("H5Gget_obj_info_max(): object type array is null");
3684         }
3685 
3686         if (lnkTypes == null) {
3687             throw new NullPointerException("H5Gget_obj_info_max(): link type array is null");
3688         }
3689 
3690         if (objNames.length <= 0) {
3691             throw new HDF5LibraryException("H5Gget_obj_info_max(): array size is zero");
3692         }
3693 
3694         if (objMax <= 0) {
3695             throw new HDF5LibraryException("H5Gget_obj_info_max(): maximum array size is zero");
3696         }
3697 
3698         if (objNames.length != objTypes.length) {
3699             throw new HDF5LibraryException("H5Gget_obj_info_max(): name and type array sizes are different");
3700         }
3701 
3702         return H5Gget_obj_info_max(loc_id, objNames, objTypes, lnkTypes, objRef, objMax, objNames.length);
3703     }
3704 
H5Gget_obj_info_max(long loc_id, String[] oname, int[] otype, int[] ltype, long[] ref, long amax, int n)3705     private synchronized static native int H5Gget_obj_info_max(long loc_id, String[] oname, int[] otype, int[] ltype,
3706             long[] ref, long amax, int n) throws HDF5LibraryException, NullPointerException;
3707 
3708     /**
3709      * H5Gn_members report the number of objects in a Group. The 'objects' include everything that will be visited by
3710      * H5Giterate. Each link is returned, so objects with multiple links will be counted once for each link.
3711      *
3712      * @param loc_id
3713      *            file or group ID.
3714      * @param name
3715      *            name of the group to iterate, relative to the loc_id
3716      *
3717      * @return the number of members in the group or -1 if error.
3718      *
3719      * @exception HDF5LibraryException
3720      *                - Error from the HDF-5 Library.
3721      * @exception NullPointerException
3722      *                - name is null.
3723      */
H5Gn_members(long loc_id, String name)3724     public synchronized static long H5Gn_members(long loc_id, String name) throws HDF5LibraryException,
3725             NullPointerException {
3726         long grp_id = H5Gopen(loc_id, name, HDF5Constants.H5P_DEFAULT);
3727         long n = -1;
3728 
3729         try {
3730             H5G_info_t info = H5.H5Gget_info(grp_id);
3731             n = info.nlinks;
3732         }
3733         finally {
3734             H5Gclose(grp_id);
3735         }
3736 
3737         return n;
3738     }
3739 
3740     /**
3741      * H5Gopen opens an existing group, name, at the location specified by loc_id.
3742      *
3743      * @param loc_id
3744      *            IN: File or group identifier specifying the location of the group to be opened.
3745      * @param name
3746      *            IN: Name of group to open.
3747      * @param gapl_id
3748      *            IN: Identifier of group access property list.
3749      *
3750      * @return a valid group identifier if successful
3751      *
3752      * @exception HDF5LibraryException
3753      *                - Error from the HDF-5 Library.
3754      * @exception NullPointerException
3755      *                - name is null.
3756      **/
H5Gopen(long loc_id, String name, long gapl_id)3757     public static long H5Gopen(long loc_id, String name, long gapl_id) throws HDF5LibraryException,
3758     NullPointerException {
3759         long id = _H5Gopen2(loc_id, name, gapl_id);
3760         if (id > 0) {
3761             log.trace("OPEN_IDS: H5Gopen add {}", id);
3762             OPEN_IDS.add(id);
3763             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
3764         }
3765         return id;
3766     }
3767 
_H5Gopen2(long loc_id, String name, long gapl_id)3768     private synchronized static native long _H5Gopen2(long loc_id, String name, long gapl_id)
3769             throws HDF5LibraryException, NullPointerException;
3770 
3771     /**
3772      * H5Gflush causes all buffers associated with a group to be immediately flushed to disk without
3773      * removing the data from the cache.
3774      *
3775      * @param group_id
3776      *            IN: Identifier of the group to be flushed.
3777      *
3778      * @exception HDF5LibraryException
3779      *                - Error from the HDF-5 Library.
3780      **/
H5Gflush(long group_id)3781     public synchronized static native void H5Gflush(long group_id) throws HDF5LibraryException;
3782 
3783     /**
3784      * H5Grefresh causes all buffers associated with a group to be cleared and immediately re-loaded
3785      * with updated contents from disk. This function essentially closes the group, evicts all metadata
3786      * associated with it from the cache, and then re-opens the group. The reopened group is automatically
3787      * re-registered with the same ID.
3788      *
3789      * @param group_id
3790      *            IN: Identifier of the group to be refreshed.
3791      *
3792      * @exception HDF5LibraryException
3793      *                - Error from the HDF-5 Library.
3794      **/
H5Grefresh(long group_id)3795     public synchronized static native void H5Grefresh(long group_id) throws HDF5LibraryException;
3796 
3797     // ////////////////////////////////////////////////////////////
3798     // //
3799     // H5HF: Fractal Heap Interface Functions //
3800     // //
3801     // ////////////////////////////////////////////////////////////
3802 
3803     // No public Functions
3804 
3805     // ////////////////////////////////////////////////////////////
3806     // //
3807     // H5HG: Global Heap Interface Functions //
3808     // //
3809     // ////////////////////////////////////////////////////////////
3810 
3811     // No public Functions
3812 
3813     // ////////////////////////////////////////////////////////////
3814     // //
3815     // H5HL: Local Heap Interface Functions //
3816     // //
3817     // ////////////////////////////////////////////////////////////
3818 
3819     // No public Functions
3820 
3821     // ////////////////////////////////////////////////////////////
3822     // //
3823     // H5I: HDF5 Identifier Interface API Functions //
3824     // //
3825     // ////////////////////////////////////////////////////////////
3826 
H5Iget_file_id(long obj_id)3827     public synchronized static native long H5Iget_file_id(long obj_id) throws HDF5LibraryException;
3828 
3829     @Deprecated
H5Iget_name_long(long obj_id, String[] name, long size)3830     public synchronized static native long H5Iget_name_long(long obj_id, String[] name, long size)
3831             throws HDF5LibraryException, NullPointerException;
3832     /**
3833      * H5Iget_name_str retrieves the name of an object specified by the identifier, obj_id.
3834      *
3835      * @param obj_id
3836      *            IN: Identifier of the object.
3837      *
3838      * @return String for Attribute name.
3839      *
3840      * @exception HDF5LibraryException
3841      *                - Error from the HDF-5 Library.
3842      **/
H5Iget_name(long obj_id)3843     public synchronized static native String H5Iget_name(long obj_id)
3844             throws HDF5LibraryException;
3845 
H5Iget_ref(long obj_id)3846     public synchronized static native int H5Iget_ref(long obj_id) throws HDF5LibraryException, NullPointerException;
3847 
H5Idec_ref(long obj_id)3848     public synchronized static native int H5Idec_ref(long obj_id) throws HDF5LibraryException, NullPointerException;
3849 
H5Iinc_ref(long obj_id)3850     public synchronized static native int H5Iinc_ref(long obj_id) throws HDF5LibraryException, NullPointerException;
3851 
3852     /**
3853      * H5Iget_type retrieves the type of the object identified by obj_id.
3854      *
3855      * @param obj_id
3856      *            IN: Object identifier whose type is to be determined.
3857      *
3858      * @return the object type if successful; otherwise H5I_BADID.
3859      *
3860      * @exception HDF5LibraryException
3861      *                - Error from the HDF-5 Library.
3862      **/
H5Iget_type(long obj_id)3863     public synchronized static native int H5Iget_type(long obj_id) throws HDF5LibraryException;
3864 
3865     /**
3866      * H5Iget_type_ref retrieves the reference count on an ID type. The reference count is used by the library to
3867      * indicate when an ID type can be destroyed.
3868      *
3869      * @param type_id
3870      *            IN: The identifier of the type whose reference count is to be retrieved
3871      *
3872      * @return The current reference count on success, negative on failure.
3873      *
3874      * @exception HDF5LibraryException
3875      *                - Error from the HDF-5 Library.
3876      **/
H5Iget_type_ref(long type_id)3877     public synchronized static native int H5Iget_type_ref(long type_id) throws HDF5LibraryException;
3878 
3879     /**
3880      * H5Idec_type_ref decrements the reference count on an identifier type. The reference count is used by the
3881      * library to indicate when an identifier type can be destroyed. If the reference count reaches zero,
3882      * this function will destroy it.
3883      *
3884      * @param type_id
3885      *            IN: The identifier of the type whose reference count is to be decremented
3886      *
3887      * @return The current reference count on success, negative on failure.
3888      *
3889      * @exception HDF5LibraryException
3890      *                - Error from the HDF-5 Library.
3891      **/
H5Idec_type_ref(long type_id)3892     public synchronized static native int H5Idec_type_ref(long type_id) throws HDF5LibraryException;
3893 
3894     /**
3895      * H5Iinc_type_ref increments the reference count on an ID type. The reference count is used by the library
3896      * to indicate when an ID type can be destroyed.
3897      *
3898      * @param type_id
3899      *            IN: The identifier of the type whose reference count is to be incremented
3900      *
3901      * @return The current reference count on success, negative on failure.
3902      *
3903      * @exception HDF5LibraryException
3904      *                - Error from the HDF-5 Library.
3905      **/
H5Iinc_type_ref(long type_id)3906     public synchronized static native int H5Iinc_type_ref(long type_id) throws HDF5LibraryException;
3907 
3908     /**
3909      * H5Inmembers returns the number of identifiers of the identifier type specified in type.
3910      *
3911      * @param type_id
3912      *            IN: Identifier for the identifier type whose member count will be retrieved
3913      *
3914      * @return Number of identifiers of the specified identifier type
3915      *
3916      * @exception HDF5LibraryException
3917      *                - Error from the HDF-5 Library.
3918      **/
H5Inmembers(long type_id)3919     public synchronized static native int H5Inmembers(long type_id) throws HDF5LibraryException;
3920 
3921     /**
3922      * H5Iis_valid indicates if the identifier type specified in obj_id is valid.
3923      *
3924      * @param obj_id
3925      *            IN: Identifier to be checked
3926      *
3927      * @return a boolean, true if the specified identifier id is valid
3928      *
3929      * @exception HDF5LibraryException
3930      *                - Error from the HDF-5 Library.
3931      **/
H5Iis_valid(long obj_id)3932     public synchronized static native boolean H5Iis_valid(long obj_id) throws HDF5LibraryException;
3933 
3934     /**
3935      * H5Itype_exists indicates if the identifier type specified in type exists.
3936      *
3937      * @param type_id
3938      *            IN: the identifier type to be checked
3939      *
3940      * @return a boolean, true if the specified identifier type exists
3941      *
3942      * @exception HDF5LibraryException
3943      *                - Error from the HDF-5 Library.
3944      **/
H5Itype_exists(int type_id)3945     public synchronized static native boolean H5Itype_exists(int type_id) throws HDF5LibraryException;
3946 
3947 
3948     /**
3949      * H5Iclear_type deletes all identifiers of the type identified by the argument type.
3950      *
3951      * @param type_id
3952      *            IN: Identifier of identifier type which is to be cleared of identifiers
3953      * @param force
3954      *            IN: Whether or not to force deletion of all identifiers
3955      *
3956      * @exception HDF5LibraryException
3957      *                - Error from the HDF-5 Library.
3958      **/
H5Iclear_type(int type_id, boolean force)3959     public synchronized static native void H5Iclear_type(int type_id, boolean force) throws HDF5LibraryException;
3960 
3961     /**
3962      * H5Idestroy_type deletes an entire identifier type. All identifiers of this type are destroyed
3963      * and no new identifiers of this type can be registered.
3964      *
3965      * @param type_id
3966      *            IN: Identifier of identifier type which is to be destroyed
3967      *
3968      * @exception HDF5LibraryException
3969      *                - Error from the HDF-5 Library.
3970      **/
H5Idestroy_type(int type_id)3971     public synchronized static native void H5Idestroy_type(int type_id) throws HDF5LibraryException;
3972 
3973     // /////// unimplemented ////////
3974 
3975     // void *H5Iobject_verify(hid_t id, H5I_type_t id_type);
3976 
3977     // hid_t H5Iregister(H5I_type_t type, const void *object);
3978 
3979     // H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func);
3980 
3981     // void *H5Iremove_verify(hid_t id, H5I_type_t id_type);
3982 
3983     // void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key);
3984 
3985     // //////////////////////////////////////////////////////////////////
3986     // H5L: Link Interface Functions //
3987     // //////////////////////////////////////////////////////////////////
3988 
3989     /**
3990      * H5Lcopy copies a link from one location to another.
3991      *
3992      * @param src_loc
3993      *            IN: Location identifier of the source link
3994      * @param src_name
3995      *            IN: Name of the link to be copied
3996      * @param dst_loc
3997      *            IN: Location identifier specifying the destination of the copy
3998      * @param dst_name
3999      *            IN: Name to be assigned to the new copy
4000      * @param lcpl_id
4001      *            IN: Link creation property list identifier
4002      * @param lapl_id
4003      *            IN: Link access property list identifier
4004      *
4005      * @exception HDF5LibraryException
4006      *                - Error from the HDF-5 Library.
4007      * @exception NullPointerException
4008      *                - name is null.
4009      **/
H5Lcopy(long src_loc, String src_name, long dst_loc, String dst_name, long lcpl_id, long lapl_id)4010     public synchronized static native void H5Lcopy(long src_loc, String src_name, long dst_loc, String dst_name,
4011             long lcpl_id, long lapl_id) throws HDF5LibraryException, NullPointerException;
4012 
4013     /**
4014      * H5Lcreate_external creates a new soft link to an external object, which is an object in a different HDF5 file
4015      * from the location of the link.
4016      *
4017      * @param file_name
4018      *            IN: Name of the target file containing the target object.
4019      * @param obj_name
4020      *            IN: Path within the target file to the target object.
4021      * @param link_loc_id
4022      *            IN: The file or group identifier for the new link.
4023      * @param link_name
4024      *            IN: The name of the new link.
4025      * @param lcpl_id
4026      *            IN: Link creation property list identifier
4027      * @param lapl_id
4028      *            IN: Link access property list identifier
4029      *
4030      * @exception HDF5LibraryException
4031      *                - Error from the HDF-5 Library.
4032      * @exception NullPointerException
4033      *                - name is null.
4034      **/
H5Lcreate_external(String file_name, String obj_name, long link_loc_id, String link_name, long lcpl_id, long lapl_id)4035     public synchronized static native void H5Lcreate_external(String file_name, String obj_name, long link_loc_id,
4036             String link_name, long lcpl_id, long lapl_id) throws HDF5LibraryException, NullPointerException;
4037 
4038     /**
4039      * H5Lcreate_hard creates a new hard link to a pre-existing object in an HDF5 file.
4040      *
4041      * @param cur_loc
4042      *            IN: The file or group identifier for the target object.
4043      * @param cur_name
4044      *            IN: Name of the target object, which must already exist.
4045      * @param dst_loc
4046      *            IN: The file or group identifier for the new link.
4047      * @param dst_name
4048      *            IN: The name of the new link.
4049      * @param lcpl_id
4050      *            IN: Link creation property list identifier
4051      * @param lapl_id
4052      *            IN: Link access property list identifier
4053      *
4054      * @exception HDF5LibraryException
4055      *                - Error from the HDF-5 Library.
4056      * @exception NullPointerException
4057      *                - cur_name or dst_name is null.
4058      **/
H5Lcreate_hard(long cur_loc, String cur_name, long dst_loc, String dst_name, long lcpl_id, long lapl_id)4059     public synchronized static native void H5Lcreate_hard(long cur_loc, String cur_name, long dst_loc, String dst_name,
4060             long lcpl_id, long lapl_id) throws HDF5LibraryException, NullPointerException;
4061 
4062     /**
4063      * H5Lcreate_soft creates a new soft link to an object in an HDF5 file.
4064      *
4065      * @param link_target
4066      *            IN: Path to the target object, which is not required to exist.
4067      * @param link_loc_id
4068      *            IN: The file or group identifier for the new link.
4069      * @param link_name
4070      *            IN: The name of the new link.
4071      * @param lcpl_id
4072      *            IN: Link creation property list identifier
4073      * @param lapl_id
4074      *            IN: Link access property list identifier
4075      *
4076      * @exception HDF5LibraryException
4077      *                - Error from the HDF-5 Library.
4078      * @exception NullPointerException
4079      *                - link_name is null.
4080      **/
H5Lcreate_soft(String link_target, long link_loc_id, String link_name, long lcpl_id, long lapl_id)4081     public synchronized static native void H5Lcreate_soft(String link_target, long link_loc_id, String link_name,
4082             long lcpl_id, long lapl_id) throws HDF5LibraryException, NullPointerException;
4083 
4084     /**
4085      * H5Ldelete removes the link specified from a group.
4086      *
4087      * @param loc_id
4088      *            IN: Identifier of the file or group containing the object.
4089      * @param name
4090      *            IN: Name of the link to delete.
4091      * @param lapl_id
4092      *            IN: Link access property list identifier
4093      *
4094      * @exception HDF5LibraryException
4095      *                - Error from the HDF-5 Library.
4096      * @exception NullPointerException
4097      *                - name is null.
4098      **/
H5Ldelete(long loc_id, String name, long lapl_id)4099     public synchronized static native void H5Ldelete(long loc_id, String name, long lapl_id)
4100             throws HDF5LibraryException, NullPointerException;
4101 
4102     /**
4103      * H5Ldelete_by_idx removes the nth link in a group according to the specified order and in the specified index.
4104      *
4105      * @param loc_id
4106      *            IN: File or group identifier specifying location of subject group
4107      * @param group_name
4108      *            IN: Name of subject group
4109      * @param idx_type
4110      *            IN: Index or field which determines the order
4111      * @param order
4112      *            IN: Order within field or index
4113      * @param n
4114      *            IN: Link for which to retrieve information
4115      * @param lapl_id
4116      *            IN: Link access property list identifier
4117      *
4118      * @exception HDF5LibraryException
4119      *                - Error from the HDF-5 Library.
4120      * @exception NullPointerException
4121      *                - group_name is null.
4122      **/
H5Ldelete_by_idx(long loc_id, String group_name, int idx_type, int order, long n, long lapl_id)4123     public synchronized static native void H5Ldelete_by_idx(long loc_id, String group_name, int idx_type, int order,
4124             long n, long lapl_id) throws HDF5LibraryException, NullPointerException;
4125 
4126     /**
4127      * H5Lexists checks if a link with a particular name exists in a group.
4128      *
4129      * @param loc_id
4130      *            IN: Identifier of the file or group to query.
4131      * @param name
4132      *            IN: The name of the link to check.
4133      * @param lapl_id
4134      *            IN: Link access property list identifier
4135      *
4136      * @return a boolean, true if the name exists, otherwise false.
4137      *
4138      * @exception HDF5LibraryException
4139      *                - Error from the HDF-5 Library.
4140      * @exception NullPointerException
4141      *                - name is null.
4142      **/
H5Lexists(long loc_id, String name, long lapl_id)4143     public synchronized static native boolean H5Lexists(long loc_id, String name, long lapl_id)
4144             throws HDF5LibraryException, NullPointerException;
4145 
4146     /**
4147      * H5Lget_info returns information about the specified link.
4148      *
4149      * @param loc_id
4150      *            IN: Identifier of the file or group.
4151      * @param name
4152      *            IN: Name of the link for which information is being sought.
4153      * @param lapl_id
4154      *            IN: Link access property list identifier
4155      *
4156      * @return a buffer(H5L_info_t) for the link information.
4157      *
4158      * @exception HDF5LibraryException
4159      *                - Error from the HDF-5 Library.
4160      * @exception NullPointerException
4161      *                - name is null.
4162      **/
H5Lget_info(long loc_id, String name, long lapl_id)4163     public synchronized static native H5L_info_t H5Lget_info(long loc_id, String name, long lapl_id)
4164             throws HDF5LibraryException, NullPointerException;
4165 
4166     /**
4167      * H5Lget_info_by_idx opens a named datatype at the location specified by loc_id and return an identifier for the
4168      * datatype.
4169      *
4170      * @param loc_id
4171      *            IN: File or group identifier specifying location of subject group
4172      * @param group_name
4173      *            IN: Name of subject group
4174      * @param idx_type
4175      *            IN: Type of index
4176      * @param order
4177      *            IN: Order within field or index
4178      * @param n
4179      *            IN: Link for which to retrieve information
4180      * @param lapl_id
4181      *            IN: Link access property list identifier
4182      *
4183      * @return a buffer(H5L_info_t) for the link information.
4184      *
4185      * @exception HDF5LibraryException
4186      *                - Error from the HDF-5 Library.
4187      * @exception NullPointerException
4188      *                - group_name is null.
4189      **/
H5Lget_info_by_idx(long loc_id, String group_name, int idx_type, int order, long n, long lapl_id)4190     public synchronized static native H5L_info_t H5Lget_info_by_idx(long loc_id, String group_name, int idx_type,
4191             int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException;
4192 
4193     /**
4194      * H5Lget_name_by_idx retrieves name of the nth link in a group, according to the order within a specified field or
4195      * index.
4196      *
4197      * @param loc_id
4198      *            IN: File or group identifier specifying location of subject group
4199      * @param group_name
4200      *            IN: Name of subject group
4201      * @param idx_type
4202      *            IN: Type of index
4203      * @param order
4204      *            IN: Order within field or index
4205      * @param n
4206      *            IN: Link for which to retrieve information
4207      * @param lapl_id
4208      *            IN: Link access property list identifier
4209      *
4210      * @return a String for the link name.
4211      *
4212      * @exception HDF5LibraryException
4213      *                - Error from the HDF-5 Library.
4214      * @exception NullPointerException
4215      *                - group_name is null.
4216      **/
H5Lget_name_by_idx(long loc_id, String group_name, int idx_type, int order, long n, long lapl_id)4217     public synchronized static native String H5Lget_name_by_idx(long loc_id, String group_name, int idx_type,
4218             int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException;
4219 
4220     /**
4221      * H5Lget_value returns the link value of a symbolic link. Note that this function is a combination
4222      * of H5Lget_info(), H5Lget_val() and for external links, H5Lunpack_elink_val.
4223      *
4224      * @param loc_id
4225      *            IN: Identifier of the file or group containing the object.
4226      * @param name
4227      *            IN: Name of the symbolic link.
4228      * @param link_value
4229      *            OUT: Path of the symbolic link, or the file_name and path of an external file.
4230      * @param lapl_id
4231      *            IN: Link access property list identifier
4232      *
4233      * @return the link type
4234      *
4235      * @exception HDF5LibraryException
4236      *                - Error from the HDF-5 Library.
4237      * @exception NullPointerException
4238      *                - name is null.
4239      **/
H5Lget_value(long loc_id, String name, String[] link_value, long lapl_id)4240     public synchronized static native int H5Lget_value(long loc_id, String name, String[] link_value, long lapl_id)
4241             throws HDF5LibraryException, NullPointerException;
4242 
4243     /**
4244      * H5Lget_value_by_idx retrieves value of the nth link in a group, according to the order within an index.
4245      * Note that this function is a combination of H5Lget_info(), H5Lget_val() and for external links,
4246      * H5Lunpack_elink_val.
4247      *
4248      * @param loc_id
4249      *            IN: File or group identifier specifying location of subject group
4250      * @param group_name
4251      *            IN: Name of subject group
4252      * @param idx_type
4253      *            IN: Type of index
4254      * @param order
4255      *            IN: Order within field or index
4256      * @param n
4257      *            IN: Link for which to retrieve information
4258      * @param link_value
4259      *            OUT: Path of the symbolic link, or the file_name and path of an external file.
4260      * @param lapl_id
4261      *            IN: Link access property list identifier
4262      *
4263      * @return the link type
4264      *
4265      * @exception HDF5LibraryException
4266      *                - Error from the HDF-5 Library.
4267      * @exception NullPointerException
4268      *                - group_name is null.
4269      **/
H5Lget_value_by_idx(long loc_id, String group_name, int idx_type, int order, long n, String[] link_value, long lapl_id)4270     public synchronized static native int H5Lget_value_by_idx(long loc_id, String group_name, int idx_type, int order,
4271             long n, String[] link_value, long lapl_id) throws HDF5LibraryException, NullPointerException;
4272 
4273     /**
4274      * H5Literate iterates through links in a group.
4275      *
4276      * @param grp_id
4277      *            IN: Identifier specifying subject group
4278      * @param idx_type
4279      *            IN: Type of index
4280      * @param order
4281      *            IN: Order of iteration within index
4282      * @param idx
4283      *            IN: Iteration position at which to start
4284      * @param op
4285      *            IN: Callback function passing data regarding the link to the calling application
4286      * @param op_data
4287      *            IN: User-defined pointer to data required by the application for its processing of the link
4288      *
4289      * @return returns the return value of the first operator that returns a positive value, or zero if all members were
4290      *         processed with no operator returning non-zero.
4291      *
4292      * @exception HDF5LibraryException
4293      *                - Error from the HDF-5 Library.
4294      **/
H5Literate(long grp_id, int idx_type, int order, long idx, H5L_iterate_cb op, H5L_iterate_t op_data)4295     public synchronized static native int H5Literate(long grp_id, int idx_type, int order, long idx, H5L_iterate_cb op,
4296             H5L_iterate_t op_data) throws HDF5LibraryException;
4297 
4298     /**
4299      * H5Literate_by_name iterates through links in a group.
4300      *
4301      * @param grp_id
4302      *            IN: Identifier specifying subject group
4303      * @param group_name
4304      *            IN: Name of subject group
4305      * @param idx_type
4306      *            IN: Type of index
4307      * @param order
4308      *            IN: Order of iteration within index
4309      * @param idx
4310      *            IN: Iteration position at which to start
4311      * @param op
4312      *            IN: Callback function passing data regarding the link to the calling application
4313      * @param op_data
4314      *            IN: User-defined pointer to data required by the application for its processing of the link
4315      * @param lapl_id
4316      *            IN: Link access property list identifier
4317      *
4318      * @return returns the return value of the first operator that returns a positive value, or zero if all members were
4319      *         processed with no operator returning non-zero.
4320      *
4321      * @exception HDF5LibraryException
4322      *                - Error from the HDF-5 Library.
4323      * @exception NullPointerException
4324      *                - group_name is null.
4325      **/
H5Literate_by_name(long grp_id, String group_name, int idx_type, int order, long idx, H5L_iterate_cb op, H5L_iterate_t op_data, long lapl_id)4326     public synchronized static native int H5Literate_by_name(long grp_id, String group_name, int idx_type, int order,
4327             long idx, H5L_iterate_cb op, H5L_iterate_t op_data, long lapl_id) throws HDF5LibraryException,
4328             NullPointerException;
4329 
4330     /**
4331      * H5Lmove renames a link within an HDF5 file.
4332      *
4333      * @param src_loc
4334      *            IN: Original file or group identifier.
4335      * @param src_name
4336      *            IN: Original link name.
4337      * @param dst_loc
4338      *            IN: Destination file or group identifier.
4339      * @param dst_name
4340      *            IN: New link name.
4341      * @param lcpl_id
4342      *            IN: Link creation property list identifier to be associated with the new link.
4343      * @param lapl_id
4344      *            IN: Link access property list identifier to be associated with the new link.
4345      *
4346      * @exception HDF5LibraryException
4347      *                - Error from the HDF-5 Library.
4348      * @exception NullPointerException
4349      *                - name is null.
4350      **/
H5Lmove(long src_loc, String src_name, long dst_loc, String dst_name, long lcpl_id, long lapl_id)4351     public synchronized static native void H5Lmove(long src_loc, String src_name, long dst_loc, String dst_name,
4352             long lcpl_id, long lapl_id) throws HDF5LibraryException, NullPointerException;
4353 
4354     /**
4355      * H5Lvisit recursively visits all links starting from a specified group.
4356      *
4357      * @param grp_id
4358      *            IN: Identifier specifying subject group
4359      * @param idx_type
4360      *            IN: Type of index
4361      * @param order
4362      *            IN: Order of iteration within index
4363      * @param op
4364      *            IN: Callback function passing data regarding the link to the calling application
4365      * @param op_data
4366      *            IN: User-defined pointer to data required by the application for its processing of the link
4367      *
4368      * @return returns the return value of the first operator that returns a positive value, or zero if all members were
4369      *         processed with no operator returning non-zero.
4370      *
4371      * @exception HDF5LibraryException
4372      *                - Error from the HDF-5 Library.
4373      **/
H5Lvisit(long grp_id, int idx_type, int order, H5L_iterate_cb op, H5L_iterate_t op_data)4374     public synchronized static native int H5Lvisit(long grp_id, int idx_type, int order, H5L_iterate_cb op,
4375             H5L_iterate_t op_data) throws HDF5LibraryException;
4376 
4377     /**
4378      * H5Lvisit_by_name recursively visits all links starting from a specified group.
4379      *
4380      * @param loc_id
4381      *            IN: Identifier specifying subject group
4382      * @param group_name
4383      *            IN: Name of subject group
4384      * @param idx_type
4385      *            IN: Type of index
4386      * @param order
4387      *            IN: Order of iteration within index
4388      * @param op
4389      *            IN: Callback function passing data regarding the link to the calling application
4390      * @param op_data
4391      *            IN: User-defined pointer to data required by the application for its processing of the link
4392      * @param lapl_id
4393      *            IN: link access property
4394      *
4395      * @return returns the return value of the first operator that returns a positive value, or zero if all members were
4396      *         processed with no operator returning non-zero.
4397      *
4398      * @exception HDF5LibraryException
4399      *                - Error from the HDF-5 Library.
4400      * @exception NullPointerException
4401      *                - group_name is null.
4402      **/
H5Lvisit_by_name(long loc_id, String group_name, int idx_type, int order, H5L_iterate_cb op, H5L_iterate_t op_data, long lapl_id)4403     public synchronized static native int H5Lvisit_by_name(long loc_id, String group_name, int idx_type, int order,
4404             H5L_iterate_cb op, H5L_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException;
4405 
4406 
4407     /**
4408      * H5Lis_registered tests whether a user-defined link class is currently registered,
4409      * either by the HDF5 Library or by the user through the use of H5Lregister.
4410      *
4411      * @param link_cls_id
4412      *            IN: User-defined link class identifier
4413      *
4414      * @return Returns a positive value if the link class has been registered and zero if it is unregistered.
4415      *         Otherwise returns a negative value; this may mean that the identifier is not a valid user-defined class identifier.
4416      *
4417      * @exception HDF5LibraryException
4418      *                - Error from the HDF-5 Library.
4419      **/
H5Lis_registered(int link_cls_id)4420     public synchronized static native int H5Lis_registered(int link_cls_id) throws HDF5LibraryException;
4421 
4422     /**
4423      * H5Lunregister unregisters a class of user-defined links, preventing them from being traversed, queried, moved, etc.
4424      *
4425      * @param link_cls_id
4426      *            IN: User-defined link class identifier
4427      *
4428      * @exception HDF5LibraryException
4429      *                - Error from the HDF-5 Library.
4430      **/
H5Lunregister(int link_cls_id)4431     public synchronized static native void H5Lunregister(int link_cls_id) throws HDF5LibraryException;
4432 
4433     // /////// unimplemented ////////
4434     // herr_t H5Lcreate_ud(hid_t link_loc_id, const char *link_name,
4435     //         H5L_type_t link_type, const void *udata, size_t udata_size, hid_t lcpl_id,
4436     //         hid_t lapl_id);
4437 
4438     // herr_t H5Lregister(const H5L_class_t *cls);
4439 
4440     // herr_t H5Lunpack_elink_val(const void *ext_linkval/*in*/, size_t link_size,
4441     //         unsigned *flags, const char **filename/*out*/, const char **obj_path /*out*/);
4442     // herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/,
4443     //        size_t size, hid_t lapl_id);
4444     // herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name,
4445     //        H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
4446     //        void *buf/*out*/, size_t size, hid_t lapl_id);
4447 
4448     // ////////////////////////////////////////////////////////////
4449     // //
4450     // H5MM: Memory Management Interface API Functions //
4451     // //
4452     // ////////////////////////////////////////////////////////////
4453 
4454     // /////// unimplemented ////////
4455     // typedef void *(*H5MM_allocate_t)(size_t size, void *alloc_info);
4456     // typedef void (*H5MM_free_t)(void *mem, void *free_info);
4457 
4458     // ////////////////////////////////////////////////////////////
4459     // //
4460     // H5O: HDF5 1.8 Object Interface API Functions //
4461     // //
4462     // ////////////////////////////////////////////////////////////
4463 
4464     /**
4465      * H5Oclose closes the group, dataset, or named datatype specified.
4466      *
4467      * @param object_id
4468      *            IN: Object identifier
4469      *
4470      * @return non-negative on success
4471      *
4472      * @exception HDF5LibraryException
4473      *                - Error from the HDF-5 Library.
4474      **/
H5Oclose(long object_id)4475     public static int H5Oclose(long object_id) throws HDF5LibraryException {
4476         if (object_id < 0)
4477             return 0; // throw new HDF5LibraryException("Negative ID");;
4478 
4479         log.trace("OPEN_IDS: H5Oclose remove {}", object_id);
4480         OPEN_IDS.remove(object_id);
4481         log.trace("OPEN_IDS: {}", OPEN_IDS.size());
4482         return _H5Oclose(object_id);
4483     }
4484 
_H5Oclose(long object_id)4485     private synchronized static native int _H5Oclose(long object_id) throws HDF5LibraryException;
4486 
4487     /**
4488      * H5Ocopy copies the group, dataset or named datatype specified from the file or group specified by source location
4489      * to the destination location.
4490      *
4491      * @param src_loc_id
4492      *            IN: Object identifier indicating the location of the source object to be copied
4493      * @param src_name
4494      *            IN: Name of the source object to be copied
4495      * @param dst_loc_id
4496      *            IN: Location identifier specifying the destination
4497      * @param dst_name
4498      *            IN: Name to be assigned to the new copy
4499      * @param ocpypl_id
4500      *            IN: Object copy property list
4501      * @param lcpl_id
4502      *            IN: Link creation property list for the new hard link
4503      *
4504      * @exception HDF5LibraryException
4505      *                - Error from the HDF-5 Library.
4506      * @exception NullPointerException
4507      *                - name is null.
4508      **/
H5Ocopy(long src_loc_id, String src_name, long dst_loc_id, String dst_name, long ocpypl_id, long lcpl_id)4509     public synchronized static native void H5Ocopy(long src_loc_id, String src_name, long dst_loc_id, String dst_name,
4510             long ocpypl_id, long lcpl_id) throws HDF5LibraryException, NullPointerException;
4511 
4512     /**
4513      * H5Oget_comment retrieves the comment for the specified object.
4514      *
4515      * @param obj_id
4516      *            IN: File or group identifier
4517      *
4518      * @return the comment
4519      *
4520      * @exception HDF5LibraryException
4521      *                - Error from the HDF-5 Library.
4522      **/
H5Oget_comment(long obj_id)4523     public synchronized static native String H5Oget_comment(long obj_id) throws HDF5LibraryException, IllegalArgumentException;
4524 
4525     /**
4526      * H5Oset_comment sets the comment for the specified object.
4527      *
4528      * @param obj_id
4529      *            IN: Identifier of the target object
4530      * @param comment
4531      *            IN: The new comment.
4532      *
4533      * @exception HDF5LibraryException
4534      *                - Error from the HDF-5 Library.
4535      *
4536      * @deprecated As of HDF5 1.8 in favor of object attributes.
4537      **/
4538     @Deprecated
H5Oset_comment(long obj_id, String comment)4539     public synchronized static native void H5Oset_comment(long obj_id, String comment) throws HDF5LibraryException;
4540 
4541     /**
4542      * H5Oget_comment_by_name retrieves the comment for an object.
4543      *
4544      * @param loc_id
4545      *            IN: Identifier of a file, group, dataset, or named datatype.
4546      * @param name
4547      *            IN: Relative name of the object whose comment is to be set or reset.
4548      * @param lapl_id
4549      *            IN: Link access property list identifier.
4550      *
4551      * @return the comment
4552      *
4553      * @exception HDF5LibraryException
4554      *                - Error from the HDF-5 Library.
4555      * @exception NullPointerException
4556      *                - name is null.
4557      **/
H5Oget_comment_by_name(long loc_id, String name, long lapl_id)4558     public synchronized static native String H5Oget_comment_by_name(long loc_id, String name, long lapl_id)
4559             throws HDF5LibraryException, IllegalArgumentException, NullPointerException;
4560 
4561     /**
4562      * H5Oset_comment_by_name sets the comment for the specified object.
4563      *
4564      * @param loc_id
4565      *            IN: Identifier of a file, group, dataset, or named datatype.
4566      * @param name
4567      *            IN: Relative name of the object whose comment is to be set or reset.
4568      * @param comment
4569      *            IN: The new comment.
4570      * @param lapl_id
4571      *            IN: Link access property list identifier.
4572      *
4573      * @exception HDF5LibraryException
4574      *                - Error from the HDF-5 Library.
4575      * @exception NullPointerException
4576      *                - name is null.
4577      *
4578      * @deprecated As of HDF5 1.8 in favor of object attributes.
4579      **/
4580     @Deprecated
H5Oset_comment_by_name(long loc_id, String name, String comment, long lapl_id)4581     public synchronized static native void H5Oset_comment_by_name(long loc_id, String name, String comment, long lapl_id)
4582             throws HDF5LibraryException, NullPointerException;
4583 
4584     /**
4585      * H5Oget_info retrieves the metadata for an object specified by an identifier.
4586      *
4587      * @param loc_id
4588      *            IN: Identifier for target object
4589      *
4590      * @return object information
4591      *
4592      * @exception HDF5LibraryException
4593      *                - Error from the HDF-5 Library.
4594      * @exception NullPointerException
4595      *                - name is null.
4596      **/
H5Oget_info(long loc_id)4597     public static H5O_info_t H5Oget_info(long loc_id) throws HDF5LibraryException,
4598             NullPointerException {
4599         return H5Oget_info(loc_id, HDF5Constants.H5O_INFO_ALL);
4600     }
4601 
4602     /**
4603      * H5Oget_info retrieves the metadata for an object specified by an identifier.
4604      *
4605      * @param loc_id
4606      *            IN: Identifier for target object
4607      * @param fields
4608      *            IN: Object fields to select
4609      *
4610      * @return object information
4611      *
4612      * @exception HDF5LibraryException
4613      *                - Error from the HDF-5 Library.
4614      * @exception NullPointerException
4615      *                - name is null.
4616      **/
H5Oget_info(long loc_id, int fields)4617     public synchronized static native H5O_info_t H5Oget_info(long loc_id, int fields) throws HDF5LibraryException,
4618             NullPointerException;
4619 
4620     /**
4621      * H5Oget_info_by_idx retrieves the metadata for an object, identifying the object by an index position.
4622      *
4623      * @param loc_id
4624      *            IN: File or group identifier
4625      * @param group_name
4626      *            IN: Name of group, relative to loc_id, in which object is located
4627      * @param idx_type
4628      *            IN: Type of index by which objects are ordered
4629      * @param order
4630      *            IN: Order of iteration within index
4631      * @param n
4632      *            IN: Object to open
4633      * @param lapl_id
4634      *            IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
4635      *            H5P_DEFAULT.)
4636      *
4637      * @return object information
4638      *
4639      * @exception HDF5LibraryException
4640      *                - Error from the HDF-5 Library.
4641      * @exception NullPointerException
4642      *                - name is null.
4643      **/
H5Oget_info_by_idx(long loc_id, String group_name, int idx_type, int order, long n, long lapl_id)4644     public static H5O_info_t H5Oget_info_by_idx(long loc_id, String group_name, int idx_type,
4645             int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException {
4646         return H5Oget_info_by_idx(loc_id, group_name, idx_type, order, n, HDF5Constants.H5O_INFO_ALL, lapl_id);
4647     }
4648 
4649     /**
4650      * H5Oget_info_by_idx retrieves the metadata for an object, identifying the object by an index position.
4651      *
4652      * @param loc_id
4653      *            IN: File or group identifier
4654      * @param group_name
4655      *            IN: Name of group, relative to loc_id, in which object is located
4656      * @param idx_type
4657      *            IN: Type of index by which objects are ordered
4658      * @param order
4659      *            IN: Order of iteration within index
4660      * @param n
4661      *            IN: Object to open
4662      * @param fields
4663      *            IN: Object fields to select
4664      * @param lapl_id
4665      *            IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
4666      *            H5P_DEFAULT.)
4667      *
4668      * @return object information
4669      *
4670      * @exception HDF5LibraryException
4671      *                - Error from the HDF-5 Library.
4672      * @exception NullPointerException
4673      *                - name is null.
4674      **/
H5Oget_info_by_idx(long loc_id, String group_name, int idx_type, int order, long n, int fields, long lapl_id)4675     public synchronized static native H5O_info_t H5Oget_info_by_idx(long loc_id, String group_name, int idx_type,
4676             int order, long n, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException;
4677 
4678     /**
4679      * H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name.
4680      *
4681      * @param loc_id
4682      *            IN: File or group identifier specifying location of group in which object is located
4683      * @param name
4684      *            IN: Relative name of group
4685      * @param lapl_id
4686      *            IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
4687      *            H5P_DEFAULT.)
4688      *
4689      * @return object information
4690      *
4691      * @exception HDF5LibraryException
4692      *                - Error from the HDF-5 Library.
4693      * @exception NullPointerException
4694      *                - name is null.
4695      **/
H5Oget_info_by_name(long loc_id, String name, long lapl_id)4696     public static H5O_info_t H5Oget_info_by_name(long loc_id, String name, long lapl_id)
4697             throws HDF5LibraryException, NullPointerException {
4698         return H5Oget_info_by_name(loc_id, name, HDF5Constants.H5O_INFO_ALL, lapl_id);
4699     }
4700 
4701     /**
4702      * H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name.
4703      *
4704      * @param loc_id
4705      *            IN: File or group identifier specifying location of group in which object is located
4706      * @param name
4707      *            IN: Relative name of group
4708      * @param fields
4709      *            IN: Object fields to select
4710      * @param lapl_id
4711      *            IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
4712      *            H5P_DEFAULT.)
4713      *
4714      * @return object information
4715      *
4716      * @exception HDF5LibraryException
4717      *                - Error from the HDF-5 Library.
4718      * @exception NullPointerException
4719      *                - name is null.
4720      **/
H5Oget_info_by_name(long loc_id, String name, int fields, long lapl_id)4721     public synchronized static native H5O_info_t H5Oget_info_by_name(long loc_id, String name, int fields, long lapl_id)
4722             throws HDF5LibraryException, NullPointerException;
4723 
4724     /**
4725      * H5Olink creates a new hard link to an object in an HDF5 file.
4726      *
4727      * @param obj_id
4728      *            IN: Object to be linked.
4729      * @param new_loc_id
4730      *            IN: File or group identifier specifying location at which object is to be linked.
4731      * @param new_name
4732      *            IN: Relative name of link to be created.
4733      * @param lcpl_id
4734      *            IN: Link creation property list identifier.
4735      * @param lapl_id
4736      *            IN: Access property list identifier.
4737      *
4738      * @exception HDF5LibraryException
4739      *                - Error from the HDF-5 Library.
4740      * @exception NullPointerException
4741      *                - name is null.
4742      **/
H5Olink(long obj_id, long new_loc_id, String new_name, long lcpl_id, long lapl_id)4743     public synchronized static native void H5Olink(long obj_id, long new_loc_id, String new_name, long lcpl_id,
4744             long lapl_id) throws HDF5LibraryException, NullPointerException;
4745 
4746     /**
4747      * H5Oopen opens a group, dataset, or named datatype specified by a location and a path name.
4748      *
4749      * @param loc_id
4750      *            IN: File or group identifier
4751      * @param name
4752      *            IN: Relative path to the object
4753      * @param lapl_id
4754      *            IN: Access property list identifier for the link pointing to the object
4755      *
4756      * @return an object identifier for the opened object
4757      *
4758      * @exception HDF5LibraryException
4759      *                - Error from the HDF-5 Library.
4760      * @exception NullPointerException
4761      *                - name is null.
4762      **/
H5Oopen(long loc_id, String name, long lapl_id)4763     public static long H5Oopen(long loc_id, String name, long lapl_id) throws HDF5LibraryException, NullPointerException {
4764         long id = _H5Oopen(loc_id, name, lapl_id);
4765         if (id > 0) {
4766             log.trace("OPEN_IDS: H5Oopen add {}", id);
4767             OPEN_IDS.add(id);
4768             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
4769         }
4770         return id;
4771     }
4772 
_H5Oopen(long loc_id, String name, long lapl_id)4773     private synchronized static native long _H5Oopen(long loc_id, String name, long lapl_id)
4774             throws HDF5LibraryException, NullPointerException;
4775 
4776     /**
4777      * H5Ovisit recursively visits all objects accessible from a specified object.
4778      *
4779      * @param obj_id
4780      *            IN: Identifier of the object at which the recursive iteration begins.
4781      * @param idx_type
4782      *            IN: Type of index
4783      * @param order
4784      *            IN: Order of iteration within index
4785      * @param op
4786      *            IN: Callback function passing data regarding the object to the calling application
4787      * @param op_data
4788      *            IN: User-defined pointer to data required by the application for its processing of the object
4789      *
4790      * @return returns the return value of the first operator that returns a positive value, or zero if all members were
4791      *         processed with no operator returning non-zero.
4792      *
4793      * @exception HDF5LibraryException
4794      *                - Error from the HDF-5 Library.
4795      * @exception NullPointerException
4796      *                - name is null.
4797      **/
H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_cb op, H5O_iterate_t op_data)4798     public static int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_cb op, H5O_iterate_t op_data)
4799             throws HDF5LibraryException, NullPointerException {
4800         return H5Ovisit(obj_id, idx_type, order, op, op_data, HDF5Constants.H5O_INFO_ALL);
4801     }
4802 
4803     /**
4804      * H5Ovisit recursively visits all objects accessible from a specified object.
4805      *
4806      * @param obj_id
4807      *            IN: Identifier of the object at which the recursive iteration begins.
4808      * @param idx_type
4809      *            IN: Type of index
4810      * @param order
4811      *            IN: Order of iteration within index
4812      * @param op
4813      *            IN: Callback function passing data regarding the object to the calling application
4814      * @param op_data
4815      *            IN: User-defined pointer to data required by the application for its processing of the object
4816      * @param fields
4817      *            IN: Object fields to select
4818      *
4819      * @return returns the return value of the first operator that returns a positive value, or zero if all members were
4820      *         processed with no operator returning non-zero.
4821      *
4822      * @exception HDF5LibraryException
4823      *                - Error from the HDF-5 Library.
4824      * @exception NullPointerException
4825      *                - name is null.
4826      **/
H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_cb op, H5O_iterate_t op_data, int fields)4827     public synchronized static native int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_cb op,
4828             H5O_iterate_t op_data, int fields) throws HDF5LibraryException, NullPointerException;
4829 
4830     /**
4831      * H5Ovisit_by_name recursively visits all objects starting from a specified object.
4832      *
4833      * @param loc_id
4834      *            IN: File or group identifier
4835      * @param obj_name
4836      *            IN: Relative path to the object
4837      * @param idx_type
4838      *            IN: Type of index
4839      * @param order
4840      *            IN: Order of iteration within index
4841      * @param op
4842      *            IN: Callback function passing data regarding the object to the calling application
4843      * @param op_data
4844      *            IN: User-defined pointer to data required by the application for its processing of the object
4845      * @param lapl_id
4846      *            IN: Link access property list identifier
4847      *
4848      * @return returns the return value of the first operator that returns a positive value, or zero if all members were
4849      *         processed with no operator returning non-zero.
4850      *
4851      * @exception HDF5LibraryException
4852      *                - Error from the HDF-5 Library.
4853      * @exception NullPointerException
4854      *                - name is null.
4855      **/
H5Ovisit_by_name(long loc_id, String obj_name, int idx_type, int order, H5O_iterate_cb op, H5O_iterate_t op_data, long lapl_id)4856     public static int H5Ovisit_by_name(long loc_id, String obj_name, int idx_type, int order,
4857             H5O_iterate_cb op, H5O_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException {
4858         return H5Ovisit_by_name(loc_id, obj_name, idx_type, order, op, op_data, HDF5Constants.H5O_INFO_ALL, lapl_id);
4859     }
4860 
4861     /**
4862      * H5Ovisit_by_name recursively visits all objects starting from a specified object.
4863      *
4864      * @param loc_id
4865      *            IN: File or group identifier
4866      * @param obj_name
4867      *            IN: Relative path to the object
4868      * @param idx_type
4869      *            IN: Type of index
4870      * @param order
4871      *            IN: Order of iteration within index
4872      * @param op
4873      *            IN: Callback function passing data regarding the object to the calling application
4874      * @param op_data
4875      *            IN: User-defined pointer to data required by the application for its processing of the object
4876      * @param fields
4877      *            IN: Object fields to select
4878      * @param lapl_id
4879      *            IN: Link access property list identifier
4880      *
4881      * @return returns the return value of the first operator that returns a positive value, or zero if all members were
4882      *         processed with no operator returning non-zero.
4883      *
4884      * @exception HDF5LibraryException
4885      *                - Error from the HDF-5 Library.
4886      * @exception NullPointerException
4887      *                - name is null.
4888      **/
H5Ovisit_by_name(long loc_id, String obj_name, int idx_type, int order, H5O_iterate_cb op, H5O_iterate_t op_data, int fields, long lapl_id)4889     public synchronized static native int H5Ovisit_by_name(long loc_id, String obj_name, int idx_type, int order,
4890             H5O_iterate_cb op, H5O_iterate_t op_data, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException;
4891 
4892 
4893     /**
4894      * H5Oexists_by_name is used by an application to check that an existing link resolves to an object.
4895      * Primarily, it is designed to check for dangling soft, external, or user-defined links.
4896      *
4897      * @param loc_id
4898      *            IN: File or group identifier
4899      * @param obj_name
4900      *            IN: Relative path to the object
4901      * @param lapl_id
4902      *            IN: Link access property list identifier
4903      *
4904      * @return Returns TRUE or FALSE if successful
4905      *
4906      * @exception HDF5LibraryException
4907      *                - Error from the HDF-5 Library.
4908      * @exception NullPointerException
4909      *                - name is null.
4910      **/
H5Oexists_by_name(long loc_id, String obj_name, long lapl_id)4911     public synchronized static native boolean H5Oexists_by_name(long loc_id, String obj_name, long lapl_id) throws HDF5LibraryException, NullPointerException;
4912 
4913     /**
4914      * H5Odecr_refcount decrements the hard link reference count for an object.
4915      *
4916      * @param object_id IN: Object identifier
4917      *
4918      * @exception HDF5LibraryException - Error from the HDF-5 Library.
4919      **/
H5Odecr_refcount(long object_id)4920     public synchronized static native void H5Odecr_refcount(long object_id) throws HDF5LibraryException;
4921 
4922     /**
4923      * H5Oincr_refcount increments the hard link reference count for an object.
4924      *
4925      * @param object_id IN: Object identifier
4926      *
4927      * @exception HDF5LibraryException - Error from the HDF-5 Library.
4928      **/
H5Oincr_refcount(long object_id)4929      public synchronized static native void H5Oincr_refcount(long object_id) throws HDF5LibraryException;
4930 
4931     /**
4932      * H5Oopen_by_addr opens a group, dataset, or named datatype using its address within an HDF5 file.
4933      *
4934      * @param loc_id IN: File or group identifier
4935      * @param addr IN: Object's address in the file
4936      *
4937      * @return an object identifier for the opened object
4938      *
4939      * @exception HDF5LibraryException - Error from the HDF-5 Library.
4940      **/
H5Oopen_by_addr(long loc_id, long addr)4941     public static long H5Oopen_by_addr(long loc_id, long addr) throws HDF5LibraryException {
4942         long id = _H5Oopen_by_addr(loc_id, addr);
4943         if (id > 0) {
4944             log.trace("OPEN_IDS: H5Oopen_by_addr add {}", id);
4945             OPEN_IDS.add(id);
4946             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
4947         }
4948         return id;
4949     }
4950 
_H5Oopen_by_addr(long loc_id, long addr)4951     private synchronized static native long _H5Oopen_by_addr(long loc_id, long addr)
4952             throws HDF5LibraryException, NullPointerException;
4953 
4954     /**
4955      * H5Oopen_by_idx opens the nth object in the group specified.
4956      *
4957      * @param loc_id IN: File or group identifier
4958      * @param group_name IN: Name of group, relative to loc_id, in which object is located
4959      * @param idx_type IN: Type of index by which objects are ordered
4960      * @param order IN: Order of iteration within index
4961      * @param n IN: Object to open
4962      * @param lapl_id IN: Access property list identifier for the link pointing to the object
4963      *
4964      * @return an object identifier for the opened object
4965      *
4966      * @exception HDF5LibraryException - Error from the HDF-5 Library.
4967      * @exception NullPointerException - group_name is null.
4968      **/
H5Oopen_by_idx(long loc_id, String group_name, int idx_type, int order, long n, long lapl_id)4969     public static long H5Oopen_by_idx(long loc_id, String group_name,
4970             int idx_type, int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException {
4971         long id = _H5Oopen_by_idx(loc_id, group_name, idx_type, order, n, lapl_id);
4972         if (id > 0) {
4973             log.trace("OPEN_IDS: H5Oopen_by_idx add {}", id);
4974             OPEN_IDS.add(id);
4975             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
4976         }
4977         return id;
4978     }
4979 
_H5Oopen_by_idx(long loc_id, String group_name, int idx_type, int order, long n, long lapl_id)4980     public synchronized static native long _H5Oopen_by_idx(long loc_id, String group_name,
4981             int idx_type, int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException;
4982 
4983     /**
4984      * H5Oflush causes all buffers associated with an object to be immediately flushed to disk without removing
4985      * the data from the cache. object_id can be any named object associated with an HDF5 file including a
4986      * dataset, a group, or a committed datatype.
4987      *
4988      * @param object_id
4989      *            IN: Identifier of the object to be flushed.
4990      *
4991      * @exception HDF5LibraryException
4992      *                - Error from the HDF-5 Library.
4993      **/
H5Oflush(long object_id)4994     public synchronized static native void H5Oflush(long object_id) throws HDF5LibraryException;
4995 
4996     /**
4997      * H5Orefresh causes all buffers associated with an object to be cleared and immediately re-loaded with
4998      * updated contents from disk. This function essentially closes the object, evicts all metadata associated
4999      * with it from the cache, and then re-opens the object. The reopened object is automatically re-registered
5000      * with the same ID. object_id can be any named object associated with an HDF5 file including a
5001      * dataset, a group, or a committed datatype.
5002      *
5003      * @param object_id
5004      *            IN: Identifier of the object to be refreshed.
5005      *
5006      * @exception HDF5LibraryException
5007      *                - Error from the HDF-5 Library.
5008      **/
H5Orefresh(long object_id)5009     public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException;
5010 
H5Odisable_mdc_flushes(long object_id)5011     public synchronized static native void  H5Odisable_mdc_flushes(long object_id);
H5Oenable_mdc_flushes(long object_id)5012     public synchronized static native void  H5Oenable_mdc_flushes(long object_id);
H5Oare_mdc_flushes_disabled(long object_id)5013     public synchronized static native boolean  H5Oare_mdc_flushes_disabled(long object_id);
5014 
5015     // ////////////////////////////////////////////////////////////
5016     // //
5017     // H5P: Property List Interface Functions //
5018     // //
5019     // ////////////////////////////////////////////////////////////
5020 
5021     // /////// Generic property list routines ///////
5022 
5023     /**
5024      * H5Pget_class_name retrieves the name of a generic property list class
5025      *
5026      * @param plid
5027      *            IN: Identifier of property object to query
5028      * @return name of a property list if successful; null if failed
5029      *
5030      * @exception HDF5LibraryException
5031      *                - Error from the HDF-5 Library.
5032      */
H5Pget_class_name(long plid)5033     public synchronized static native String H5Pget_class_name(long plid) throws HDF5LibraryException;
5034 
5035     /**
5036      * H5Pcreate creates a new property as an instance of some property list class.
5037      *
5038      * @param type
5039      *            IN: The type of property list to create.
5040      *
5041      * @return a property list identifier (plist) if successful; otherwise Fail (-1).
5042      *
5043      * @exception HDF5LibraryException
5044      *                - Error from the HDF-5 Library.
5045      **/
H5Pcreate(long type)5046     public static long H5Pcreate(long type) throws HDF5LibraryException {
5047         long id = _H5Pcreate(type);
5048         if (id > 0) {
5049             log.trace("OPEN_IDS: H5Pcreate add {}", id);
5050             OPEN_IDS.add(id);
5051             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
5052         }
5053         return id;
5054     }
5055 
_H5Pcreate(long type)5056     private synchronized static native long _H5Pcreate(long type) throws HDF5LibraryException;
5057 
5058     /**
5059      * H5Pget retrieves a copy of the value for a property in a property list (support integer only)
5060      *
5061      * @param plid
5062      *            IN: Identifier of property object to query
5063      * @param name
5064      *            IN: Name of property to query
5065      * @return value for a property if successful; a negative value if failed
5066      *
5067      * @exception HDF5LibraryException
5068      *                - Error from the HDF-5 Library.
5069      */
H5Pget(long plid, String name)5070     public synchronized static native int H5Pget(long plid, String name) throws HDF5LibraryException;
5071 
5072     /**
5073      * Sets a property list value (support integer only)
5074      *
5075      * @param plid
5076      *            IN: Property list identifier to modify
5077      * @param name
5078      *            IN: Name of property to modify
5079      * @param value
5080      *            IN: value to set the property to
5081      * @return a non-negative value if successful; a negative value if failed
5082      *
5083      * @exception HDF5LibraryException
5084      *                - Error from the HDF-5 Library.
5085      */
H5Pset(long plid, String name, int value)5086     public synchronized static native int H5Pset(long plid, String name, int value) throws HDF5LibraryException;
5087 
5088     /**
5089      * H5Pexist determines whether a property exists within a property list or class
5090      *
5091      * @param plid
5092      *            IN: Identifier for the property to query
5093      * @param name
5094      *            IN: Name of property to check for
5095      * @return a true value if the property exists in the property object; false if the property does not exist;
5096      *
5097      * @exception HDF5LibraryException
5098      *                - Error from the HDF-5 Library.
5099      */
H5Pexist(long plid, String name)5100     public synchronized static native boolean H5Pexist(long plid, String name) throws HDF5LibraryException;
5101 
5102     /**
5103      * H5Pget_size retrieves the size of a property's value in bytes
5104      *
5105      * @param plid
5106      *            IN: Identifier of property object to query
5107      * @param name
5108      *            IN: Name of property to query
5109      * @return size of a property's value if successful; a negative value if failed
5110      *
5111      * @exception HDF5LibraryException
5112      *                - Error from the HDF-5 Library.
5113      */
H5Pget_size(long plid, String name)5114     public synchronized static native long H5Pget_size(long plid, String name) throws HDF5LibraryException;
5115 
5116     /**
5117      * H5Pget_nprops retrieves the number of properties in a property list or class
5118      *
5119      * @param plid
5120      *            IN: Identifier of property object to query
5121      * @return number of properties if successful; a negative value if failed
5122      *
5123      * @exception HDF5LibraryException
5124      *                - Error from the HDF-5 Library.
5125      */
H5Pget_nprops(long plid)5126     public synchronized static native long H5Pget_nprops(long plid) throws HDF5LibraryException;
5127 
5128     /**
5129      * H5Pget_class returns the property list class for the property list identified by the plist parameter.
5130      *
5131      * @param plist
5132      *            IN: Identifier of property list to query.
5133      * @return a property list class if successful. Otherwise returns H5P_ROOT (-1).
5134      *
5135      * @exception HDF5LibraryException
5136      *                - Error from the HDF-5 Library.
5137      **/
H5Pget_class(long plist)5138     public synchronized static native long H5Pget_class(long plist) throws HDF5LibraryException;
5139 
5140     /**
5141      * H5Pget_class_parent retrieves an identifier for the parent class of a property class
5142      *
5143      * @param plid
5144      *            IN: Identifier of the property class to query
5145      * @return a valid parent class object identifier if successful; a negative value if failed
5146      *
5147      * @exception HDF5LibraryException
5148      *                - Error from the HDF-5 Library.
5149      */
H5Pget_class_parent(long plid)5150     public synchronized static native long H5Pget_class_parent(long plid) throws HDF5LibraryException;
5151 
5152     /**
5153      * H5Pequal determines if two property lists or classes are equal
5154      *
5155      * @param plid1
5156      *            IN: First property object to be compared
5157      * @param plid2
5158      *            IN: Second property object to be compared
5159      * @return positive value if equal; zero if unequal, a negative value if failed
5160      *
5161      * @exception HDF5LibraryException
5162      *                - Error from the HDF-5 Library.
5163      */
H5Pequal(long plid1, long plid2)5164     public synchronized static native int H5Pequal(long plid1, long plid2) throws HDF5LibraryException;
5165 
H5P_equal(long plid1, long plid2)5166     public static boolean H5P_equal(long plid1, long plid2) throws HDF5LibraryException {
5167         if (H5Pequal(plid1, plid2) == 1)
5168             return true;
5169         return false;
5170     }
5171 
5172     /**
5173      * H5Pisa_class checks to determine whether a property list is a member of the specified class
5174      *
5175      * @param plist
5176      *            IN: Identifier of the property list
5177      * @param pclass
5178      *            IN: Identifier of the property class
5179      * @return a positive value if equal; zero if unequal; a negative value if failed
5180      *
5181      * @exception HDF5LibraryException
5182      *                - Error from the HDF-5 Library.
5183      */
H5Pisa_class(long plist, long pclass)5184     public synchronized static native int H5Pisa_class(long plist, long pclass) throws HDF5LibraryException;
5185 
5186     /**
5187      * H5Pcopy_prop copies a property from one property list or class to another
5188      *
5189      * @param dst_id
5190      *            IN: Identifier of the destination property list or class
5191      * @param src_id
5192      *            IN: Identifier of the source property list or class
5193      * @param name
5194      *            IN: Name of the property to copy
5195      * @return a non-negative value if successful; a negative value if failed
5196      *
5197      * @exception HDF5LibraryException
5198      *                - Error from the HDF-5 Library.
5199      */
H5Pcopy_prop(long dst_id, long src_id, String name)5200     public synchronized static native int H5Pcopy_prop(long dst_id, long src_id, String name)
5201             throws HDF5LibraryException;
5202 
5203     /**
5204      * H5Premove removes a property from a property list
5205      *
5206      * @param plid
5207      *            IN: Identifier of the property list to modify
5208      * @param name
5209      *            IN: Name of property to remove
5210      * @return a non-negative value if successful; a negative value if failed
5211      *
5212      * @exception HDF5LibraryException
5213      *                - Error from the HDF-5 Library.
5214      */
H5Premove(long plid, String name)5215     public synchronized static native int H5Premove(long plid, String name) throws HDF5LibraryException;
5216 
5217     /**
5218      * H5Punregister removes a property from a property list class
5219      *
5220      * @param plid
5221      *            IN: Property list class from which to remove permanent property
5222      * @param name
5223      *            IN: Name of property to remove
5224      * @return a non-negative value if successful; a negative value if failed
5225      *
5226      * @exception HDF5LibraryException
5227      *                - Error from the HDF-5 Library.
5228      */
H5Punregister(long plid, String name)5229     public synchronized static native int H5Punregister(long plid, String name) throws HDF5LibraryException;
5230 
5231     /**
5232      * Closes an existing property list class
5233      *
5234      * @param plid
5235      *            IN: Property list class to close
5236      * @return a non-negative value if successful; a negative value if failed
5237      *
5238      * @exception HDF5LibraryException
5239      *                - Error from the HDF-5 Library.
5240      */
H5Pclose_class(long plid)5241     public static int H5Pclose_class(long plid) throws HDF5LibraryException {
5242         if (plid < 0)
5243             return 0; // throw new HDF5LibraryException("Negative ID");;
5244 
5245         log.trace("OPEN_IDS: H5Pclose_class remove {}", plid);
5246         OPEN_IDS.remove(plid);
5247         log.trace("OPEN_IDS: {}", OPEN_IDS.size());
5248         return _H5Pclose_class(plid);
5249     }
5250 
_H5Pclose_class(long plid)5251     public synchronized static native int _H5Pclose_class(long plid) throws HDF5LibraryException;
5252 
5253     /**
5254      * H5Pclose terminates access to a property list.
5255      *
5256      * @param plist
5257      *            IN: Identifier of the property list to terminate access to.
5258      * @return a non-negative value if successful
5259      *
5260      * @exception HDF5LibraryException
5261      *                - Error from the HDF-5 Library.
5262      **/
H5Pclose(long plist)5263     public static int H5Pclose(long plist) throws HDF5LibraryException {
5264         if (plist < 0)
5265             return 0; // throw new HDF5LibraryException("Negative ID");;
5266 
5267         log.trace("OPEN_IDS: H5Pclose remove {}", plist);
5268         OPEN_IDS.remove(plist);
5269         log.trace("OPEN_IDS: {}", OPEN_IDS.size());
5270         return _H5Pclose(plist);
5271     }
5272 
_H5Pclose(long plist)5273     private synchronized static native int _H5Pclose(long plist) throws HDF5LibraryException;
5274 
5275     /**
5276      * H5Pcopy copies an existing property list to create a new property list.
5277      *
5278      * @param plist
5279      *            IN: Identifier of property list to duplicate.
5280      *
5281      * @return a property list identifier if successful
5282      *
5283      * @exception HDF5LibraryException
5284      *                - Error from the HDF-5 Library.
5285      **/
H5Pcopy(long plist)5286     public static long H5Pcopy(long plist) throws HDF5LibraryException {
5287         long id = _H5Pcopy(plist);
5288         if (id > 0) {
5289             log.trace("OPEN_IDS: H5Pcopy add {}", id);
5290             OPEN_IDS.add(id);
5291             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
5292         }
5293         return id;
5294     }
5295 
_H5Pcopy(long plist)5296     private synchronized static native long _H5Pcopy(long plist) throws HDF5LibraryException;
5297 
H5Pcreate_class_nocb(long parent_class, String name)5298     public static long H5Pcreate_class_nocb(long parent_class, String name) throws HDF5LibraryException {
5299         long id = _H5Pcreate_class_nocb(parent_class, name);
5300           if (id > 0) {
5301             log.trace("OPEN_IDS: H5Pcreate_class_nocb add {}", id);
5302             OPEN_IDS.add(id);
5303             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
5304         }
5305         return id;
5306     }
5307 
_H5Pcreate_class_nocb(long parent_class, String name)5308     private synchronized static native long _H5Pcreate_class_nocb(long parent_class, String name) throws HDF5LibraryException;
5309 
5310 //    public static long H5Pcreate_class(long parent_class, String name, H5P_cls_create_func_cb create_op, H5P_cls_create_func_t create_data,
5311 //             H5P_cls_copy_func_cb copy_op, H5P_cls_copy_func_t copy_data, H5P_cls_close_func_cb close_op, H5P_cls_close_func_t close_data) throws HDF5LibraryException {
5312 //        long id = _H5Pcreate_class(parent_class, name, create_op, create_data, copy_op, copy_data, close_op, close_data);
5313 //          if (id > 0) {
5314 //            log.trace("OPEN_IDS: H5Pcreate_class add {}", id);
5315 //            OPEN_IDS.add(id);
5316 //            log.trace("OPEN_IDS: {}", OPEN_IDS.size());
5317 //        }
5318 //        return id;
5319 //    }
5320 //
5321 //    private synchronized static native long _H5Pcreate_class(long parent_class, String name, H5P_cls_create_func_cb create_op, H5P_cls_create_func_t create_data,
5322 //            H5P_cls_copy_func_cb copy_op, H5P_cls_copy_func_t copy_data, H5P_cls_close_func_cb close_op, H5P_cls_close_func_t close_data) throws HDF5LibraryException;
5323 
H5Pregister2_nocb(long plist_class, String name, long size, byte[] def_value)5324     public synchronized static native void H5Pregister2_nocb(long plist_class, String name, long size, byte[] def_value) throws HDF5LibraryException;
5325 
5326 //    public synchronized static native void H5Pregister2(long plist_class, String name, long size, byte[] def_value, H5P_prp_create_func_cb prp_create, H5P_prp_set_func_cb prp_set,
5327 //          H5P_prp_get_func_cb prp_get, H5P_prp_delete_func_cb prp_delete, H5P_prp_copy_func_cb prp_copy, H5P_prp_compare_func_cb prp_cmp, H5P_prp_close_func_cb prp_close) throws HDF5LibraryException;
5328 
H5Pinsert2_nocb(long plist, String name, long size, byte[] value)5329      public synchronized static native void H5Pinsert2_nocb(long plist, String name, long size,  byte[] value) throws HDF5LibraryException;
5330 
5331 
5332     // public synchronized static native void H5Pinsert2(long plist, String name, long size,  byte[] value, H5P_prp_set_func_cb prp_set, H5P_prp_get_func_cb prp_get,
5333     //      H5P_prp_delete_func_cb prp_delete, H5P_prp_copy_func_cb prp_copy, H5P_prp_compare_func_cb prp_cmp, H5P_prp_close_func_cb prp_close) throws HDF5LibraryException;
5334 
H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data)5335     public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException;
5336 
5337     // /////// Object creation property list (OCPL) routines ///////
5338 
5339     /**
5340      * H5Pget_attr_phase_change retrieves attribute storage phase change thresholds.
5341      *
5342      * @param ocpl_id
5343      *            IN: : Object (dataset or group) creation property list identifier
5344      * @param attributes
5345      *            The maximun and minimum no. of attributes to be stored.
5346      *
5347      *            <pre>
5348      *      attributes[0] =  The maximum number of attributes to be stored in compact storage
5349      *      attributes[1] =  The minimum number of attributes to be stored in dense storage
5350      * </pre>
5351      *
5352      * @return Returns a non-negative value if successful; otherwise returns a negative value.
5353      *
5354      * @exception HDF5LibraryException
5355      *                - Error from the HDF-5 Library.
5356      * @exception NullPointerException
5357      *                - size is null.
5358      *
5359      **/
H5Pget_attr_phase_change(long ocpl_id, int[] attributes)5360     public synchronized static native int H5Pget_attr_phase_change(long ocpl_id, int[] attributes)
5361             throws HDF5LibraryException, NullPointerException;
5362 
5363     /**
5364      * H5Pset_attr_phase_change sets threshold values for attribute storage on an object. These
5365      *      thresholds determine the point at which attribute storage changes
5366      *      from compact storage (i.e., storage in the object header)
5367      *      to dense storage (i.e., storage in a heap and indexed with a B-tree).
5368      *
5369      * @param ocpl_id
5370      *            IN: : Object (dataset or group) creation property list identifier
5371      * @param max_compact
5372      *            IN: Maximum number of attributes to be stored in compact storage (Default: 8)
5373      * @param min_dense
5374      *            IN: Minimum number of attributes to be stored in dense storage (Default: 6)
5375      *
5376      * @exception HDF5LibraryException
5377      *                - Error from the HDF-5 Library.
5378      *
5379      **/
H5Pset_attr_phase_change(long ocpl_id, int max_compact, int min_dense)5380     public synchronized static native void H5Pset_attr_phase_change(long ocpl_id, int max_compact, int min_dense)
5381             throws HDF5LibraryException;
5382 
5383     /**
5384      * H5Pget_attr_creation_order retrieves the settings for tracking and indexing attribute creation order on an object
5385      *
5386      * @param ocpl_id
5387      *            IN: Object (group or dataset) creation property list identifier
5388      *
5389      * @return Flags specifying whether to track and index attribute creation order
5390      *
5391      * @exception HDF5LibraryException
5392      *                - Error from the HDF-5 Library.
5393      *
5394      **/
H5Pget_attr_creation_order(long ocpl_id)5395     public synchronized static native int H5Pget_attr_creation_order(long ocpl_id) throws HDF5LibraryException;
5396 
5397     /**
5398      * H5Pset_attr_creation_order sets flags specifying whether to track and index attribute creation order on an
5399      * object.
5400      *
5401      * @param ocpl_id
5402      *            IN: Object creation property list identifier
5403      * @param crt_order_flags
5404      *            IN: Flags specifying whether to track and index attribute creation order
5405      *
5406      * @return Returns a non-negative value if successful; otherwise returns a negative value.
5407      *
5408      * @exception HDF5LibraryException
5409      *                - Error from the HDF-5 Library.
5410      *
5411      **/
H5Pset_attr_creation_order(long ocpl_id, int crt_order_flags)5412     public synchronized static native int H5Pset_attr_creation_order(long ocpl_id, int crt_order_flags)
5413             throws HDF5LibraryException;
5414 
5415     /**
5416      * H5Pget_obj_track_times queries the object creation property list, ocpl_id, to determine whether object times are
5417      * being recorded.
5418      *
5419      * @param ocpl_id
5420      *            IN: Object creation property list identifier
5421      *
5422      * @return TRUE or FALSE, specifying whether object times are being recorded
5423      *
5424      * @exception HDF5LibraryException
5425      *                - Error from the HDF-5 Library.
5426      *
5427      **/
H5Pget_obj_track_times(long ocpl_id)5428     public synchronized static native boolean H5Pget_obj_track_times(long ocpl_id) throws HDF5LibraryException;
5429 
5430     /**
5431      * H5Pset_obj_track_times sets a property in the object creation property list, ocpl_id, that governs the recording
5432      * of times associated with an object.
5433      *
5434      * @param ocpl_id
5435      *            IN: Object creation property list identifier
5436      *
5437      * @param track_times
5438      *            IN: TRUE or FALSE, specifying whether object times are to be tracked
5439      *
5440      * @exception HDF5LibraryException
5441      *                - Error from the HDF-5 Library.
5442      *
5443      **/
H5Pset_obj_track_times(long ocpl_id, boolean track_times)5444     public synchronized static native void H5Pset_obj_track_times(long ocpl_id, boolean track_times)
5445             throws HDF5LibraryException;
5446 
H5Pmodify_filter(long plist, long filter, int flags, long cd_nelmts, int[] cd_values)5447     public synchronized static native int H5Pmodify_filter(long plist, long filter, int flags, long cd_nelmts,
5448             int[] cd_values) throws HDF5LibraryException, NullPointerException;
5449 
5450     /**
5451      * H5Pset_filter adds the specified filter and corresponding properties to the end of an output filter pipeline.
5452      *
5453      * @param plist
5454      *            IN: Property list identifier.
5455      * @param filter
5456      *            IN: Filter to be added to the pipeline.
5457      * @param flags
5458      *            IN: Bit vector specifying certain general properties of the filter.
5459      * @param cd_nelmts
5460      *            IN: Number of elements in cd_values
5461      * @param cd_values
5462      *            IN: Auxiliary data for the filter.
5463      *
5464      * @return a non-negative value if successful
5465      *
5466      * @exception HDF5LibraryException
5467      *                - Error from the HDF-5 Library.
5468      **/
H5Pset_filter(long plist, int filter, int flags, long cd_nelmts, int[] cd_values)5469     public synchronized static native int H5Pset_filter(long plist, int filter, int flags, long cd_nelmts,
5470             int[] cd_values) throws HDF5LibraryException;
5471 
5472     /**
5473      * H5Pget_nfilters returns the number of filters defined in the filter pipeline associated with the property list
5474      * plist.
5475      *
5476      * @param plist
5477      *            IN: Property list identifier.
5478      *
5479      * @return the number of filters in the pipeline if successful
5480      *
5481      * @exception HDF5LibraryException
5482      *                - Error from the HDF-5 Library.
5483      **/
H5Pget_nfilters(long plist)5484     public synchronized static native int H5Pget_nfilters(long plist) throws HDF5LibraryException;
5485 
5486     /**
5487      * H5Pget_filter returns information about a filter, specified by its filter number, in a filter pipeline, specified
5488      * by the property list with which it is associated.
5489      *
5490      * @param plist
5491      *            IN: Property list identifier.
5492      * @param filter_number
5493      *            IN: Sequence number within the filter pipeline of the filter for which information is sought.
5494      * @param flags
5495      *            OUT: Bit vector specifying certain general properties of the filter.
5496      * @param cd_nelmts
5497      *            IN/OUT: Number of elements in cd_values
5498      * @param cd_values
5499      *            OUT: Auxiliary data for the filter.
5500      * @param namelen
5501      *            IN: Anticipated number of characters in name.
5502      * @param name
5503      *            OUT: Name of the filter.
5504      * @param filter_config
5505      *            OUT:A bit field encoding the returned filter information
5506      *
5507      * @return the filter identification number if successful. Otherwise returns H5Z_FILTER_ERROR (-1).
5508      *
5509      * @exception ArrayIndexOutOfBoundsException
5510      *                Fatal error on Copyback
5511      * @exception ArrayStoreException
5512      *                Fatal error on Copyback
5513      * @exception HDF5LibraryException
5514      *                - Error from the HDF-5 Library.
5515      * @exception NullPointerException
5516      *                - name or an array is null.
5517      *
5518      **/
H5Pget_filter(long plist, int filter_number, int[] flags, long[] cd_nelmts, int[] cd_values, long namelen, String[] name, int[] filter_config)5519     public static int H5Pget_filter(long plist, int filter_number, int[] flags, long[] cd_nelmts, int[] cd_values,
5520             long namelen, String[] name, int[] filter_config) throws ArrayIndexOutOfBoundsException,
5521             ArrayStoreException, HDF5LibraryException, NullPointerException {
5522         return H5Pget_filter2(plist, filter_number, flags, cd_nelmts, cd_values, namelen, name, filter_config);
5523     }
5524 
5525     /**
5526      * H5Pget_filter2 returns information about a filter, specified by its filter number, in a filter pipeline,
5527      * specified by the property list with which it is associated.
5528      *
5529      * @see public static int H5Pget_filter(int plist, int filter_number, int[] flags, int[] cd_nelmts, int[] cd_values,
5530      *      int namelen, String[] name, int[] filter_config)
5531      *
5532      **/
H5Pget_filter2(long plist, int filter_number, int[] flags, long[] cd_nelmts, int[] cd_values, long namelen, String[] name, int[] filter_config)5533     private synchronized static native int H5Pget_filter2(long plist, int filter_number, int[] flags, long[] cd_nelmts,
5534             int[] cd_values, long namelen, String[] name, int[] filter_config) throws ArrayIndexOutOfBoundsException,
5535             ArrayStoreException, HDF5LibraryException, NullPointerException;
5536 
5537     /**
5538      * H5Pget_filter_by_id returns information about the filter specified in filter_id, a filter identifier. plist_id
5539      * must be a dataset or group creation property list and filter_id must be in the associated filter pipeline. The
5540      * filter_id and flags parameters are used in the same manner as described in the discussion of H5Pset_filter. Aside
5541      * from the fact that they are used for output, the parameters cd_nelmts and cd_values[] are used in the same manner
5542      * as described in the discussion of H5Pset_filter. On input, the cd_nelmts parameter indicates the number of
5543      * entries in the cd_values[] array allocated by the calling program; on exit it contains the number of values
5544      * defined by the filter. On input, the namelen parameter indicates the number of characters allocated for the
5545      * filter name by the calling program in the array name[]. On exit name[] contains the name of the filter with one
5546      * character of the name in each element of the array. If the filter specified in filter_id is not set for the
5547      * property list, an error will be returned and H5Pget_filter_by_id1 will fail.
5548      *
5549      * @param plist_id
5550      *            IN: Property list identifier.
5551      * @param filter_id
5552      *            IN: Filter identifier.
5553      * @param flags
5554      *            OUT: Bit vector specifying certain general properties of the filter.
5555      * @param cd_nelmts
5556      *            N/OUT: Number of elements in cd_values
5557      * @param cd_values
5558      *            OUT: Auxiliary data for the filter.
5559      * @param namelen
5560      *            IN: Anticipated number of characters in name.
5561      * @param name
5562      *            OUT: Name of the filter.
5563      * @param filter_config
5564      *            OUT: A bit field encoding the returned filter information
5565      *
5566      * @return the filter identification number if successful. Otherwise returns H5Z_FILTER_ERROR (-1).
5567      *
5568      * @exception HDF5LibraryException
5569      *                - Error from the HDF-5 Library.
5570      * @exception ArrayIndexOutOfBoundsException
5571      *                Fatal error on Copyback
5572      * @exception ArrayStoreException
5573      *                Fatal error on Copyback
5574      * @exception NullPointerException
5575      *                - name or an array is null.
5576      *
5577      **/
H5Pget_filter_by_id(long plist_id, long filter_id, int[] flags, long[] cd_nelmts, int[] cd_values, long namelen, String[] name, int[] filter_config)5578     public static int H5Pget_filter_by_id(long plist_id, long filter_id, int[] flags, long[] cd_nelmts,
5579             int[] cd_values, long namelen, String[] name, int[] filter_config) throws ArrayIndexOutOfBoundsException,
5580             ArrayStoreException, HDF5LibraryException, NullPointerException {
5581         return H5Pget_filter_by_id2(plist_id, filter_id, flags, cd_nelmts, cd_values, namelen, name, filter_config);
5582     }
5583 
5584     /**
5585      * H5Pget_filter_by_id2 returns information about a filter, specified by its filter id, in a filter pipeline,
5586      * specified by the property list with which it is associated.
5587      *
5588      * @param plist_id
5589      *            IN: Property list identifier.
5590      * @param filter_id
5591      *            IN: Filter identifier.
5592      * @param flags
5593      *            OUT: Bit vector specifying certain general properties of the filter.
5594      * @param cd_nelmts
5595      *            N/OUT: Number of elements in cd_values
5596      * @param cd_values
5597      *            OUT: Auxiliary data for the filter.
5598      * @param namelen
5599      *            IN: Anticipated number of characters in name.
5600      * @param name
5601      *            OUT: Name of the filter.
5602      * @param filter_config
5603      *            OUT: A bit field encoding the returned filter information
5604      *
5605      * @return the filter identification number if successful. Otherwise returns H5Z_FILTER_ERROR (-1).
5606      *
5607      * @exception HDF5LibraryException
5608      *                - Error from the HDF-5 Library.
5609      * @exception NullPointerException
5610      *                - name or an array is null.
5611      *
5612      **/
H5Pget_filter_by_id2(long plist_id, long filter_id, int[] flags, long[] cd_nelmts, int[] cd_values, long namelen, String[] name, int[] filter_config)5613     public synchronized static native int H5Pget_filter_by_id2(long plist_id, long filter_id, int[] flags,
5614             long[] cd_nelmts, int[] cd_values, long namelen, String[] name, int[] filter_config)
5615                     throws HDF5LibraryException, NullPointerException;
5616 
5617 
H5Pall_filters_avail(long dcpl_id)5618     public synchronized static native boolean H5Pall_filters_avail(long dcpl_id) throws HDF5LibraryException,
5619     NullPointerException;
5620 
H5Premove_filter(long obj_id, long filter)5621     public synchronized static native int H5Premove_filter(long obj_id, long filter) throws HDF5LibraryException;
5622 
5623     /**
5624      * H5Pset_deflate sets the compression method for a dataset.
5625      *
5626      * @param plist
5627      *            IN: Identifier for the dataset creation property list.
5628      * @param level
5629      *            IN: Compression level.
5630      *
5631      * @return non-negative if successful
5632      *
5633      * @exception HDF5LibraryException
5634      *                - Error from the HDF-5 Library.
5635      **/
H5Pset_deflate(long plist, int level)5636     public synchronized static native int H5Pset_deflate(long plist, int level) throws HDF5LibraryException;
5637 
H5Pset_fletcher32(long plist)5638     public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException,
5639     NullPointerException;
5640 
5641     // /////// File creation property list (FCPL) routines ///////
5642 
5643     /**
5644      * H5Pget_userblock retrieves the size of a user block in a file creation property list.
5645      *
5646      * @param plist
5647      *            IN: Identifier for property list to query.
5648      * @param size
5649      *            OUT: Pointer to location to return user-block size.
5650      *
5651      * @return a non-negative value and the size of the user block; if successful
5652      *
5653      * @exception HDF5LibraryException
5654      *                - Error from the HDF-5 Library.
5655      * @exception NullPointerException
5656      *                - size is null.
5657      **/
H5Pget_userblock(long plist, long[] size)5658     public synchronized static native int H5Pget_userblock(long plist, long[] size) throws HDF5LibraryException,
5659     NullPointerException;
5660 
5661     /**
5662      * H5Pset_userblock sets the user block size of a file creation property list.
5663      *
5664      * @param plist
5665      *            IN: Identifier of property list to modify.
5666      * @param size
5667      *            IN: Size of the user-block in bytes.
5668      *
5669      * @return a non-negative value if successful
5670      *
5671      * @exception HDF5LibraryException
5672      *                - Error from the HDF-5 Library.
5673      **/
H5Pset_userblock(long plist, long size)5674     public synchronized static native int H5Pset_userblock(long plist, long size) throws HDF5LibraryException;
5675 
5676     /**
5677      * H5Pget_sizes retrieves the size of the offsets and lengths used in an HDF5 file. This function is only valid for
5678      * file creation property lists.
5679      *
5680      * @param plist
5681      *            IN: Identifier of property list to query.
5682      * @param size
5683      *            OUT: the size of the offsets and length.
5684      *
5685      *            <pre>
5686      *      size[0] = sizeof_addr // offset size in bytes
5687      *      size[1] = sizeof_size // length size in bytes
5688      * </pre>
5689      * @return a non-negative value with the sizes initialized; if successful;
5690      *
5691      * @exception HDF5LibraryException
5692      *                - Error from the HDF-5 Library.
5693      * @exception NullPointerException
5694      *                - size is null.
5695      * @exception IllegalArgumentException
5696      *                - size is invalid.
5697      **/
H5Pget_sizes(long plist, long[] size)5698     public synchronized static native int H5Pget_sizes(long plist, long[] size) throws HDF5LibraryException,
5699     NullPointerException, IllegalArgumentException;
5700 
5701     /**
5702      * H5Pset_sizes sets the byte size of the offsets and lengths used to address objects in an HDF5 file.
5703      *
5704      * @param plist
5705      *            IN: Identifier of property list to modify.
5706      * @param sizeof_addr
5707      *            IN: Size of an object offset in bytes.
5708      * @param sizeof_size
5709      *            IN: Size of an object length in bytes.
5710      *
5711      * @return a non-negative value if successful
5712      *
5713      * @exception HDF5LibraryException
5714      *                - Error from the HDF-5 Library.
5715      **/
H5Pset_sizes(long plist, int sizeof_addr, int sizeof_size)5716     public synchronized static native int H5Pset_sizes(long plist, int sizeof_addr, int sizeof_size)
5717             throws HDF5LibraryException;
5718 
5719     /**
5720      * H5Pget_sym_k retrieves the size of the symbol table B-tree 1/2 rank and the symbol table leaf node 1/2 size.
5721      *
5722      * @param plist
5723      *            IN: Property list to query.
5724      * @param size
5725      *            OUT: the symbol table's B-tree 1/2 rank and leaf node 1/2size.
5726      *
5727      *            <pre>
5728      *      size[0] = ik // the symbol table's B-tree 1/2 rank
5729      *      size[1] = lk // leaf node 1/2 size
5730      * </pre>
5731      *
5732      * @return a non-negative value if successful
5733      *
5734      * @exception HDF5LibraryException
5735      *                - Error from the HDF-5 Library.
5736      * @exception NullPointerException
5737      *                - size is null.
5738      * @exception IllegalArgumentException
5739      *                - size is invalid.
5740      **/
H5Pget_sym_k(long plist, int[] size)5741     public synchronized static native int H5Pget_sym_k(long plist, int[] size) throws HDF5LibraryException,
5742     NullPointerException, IllegalArgumentException;
5743 
5744     /**
5745      * H5Pset_sym_k sets the size of parameters used to control the symbol table nodes.
5746      *
5747      * @param plist
5748      *            IN: Identifier for property list to query.
5749      * @param ik
5750      *            IN: Symbol table tree rank.
5751      * @param lk
5752      *            IN: Symbol table node size.
5753      *
5754      * @return a non-negative value if successful
5755      *
5756      * @exception HDF5LibraryException
5757      *                - Error from the HDF-5 Library.
5758      **/
H5Pset_sym_k(long plist, int ik, int lk)5759     public synchronized static native int H5Pset_sym_k(long plist, int ik, int lk) throws HDF5LibraryException;
5760 
5761     /**
5762      * H5Pget_istore_k queries the 1/2 rank of an indexed storage B-tree.
5763      *
5764      * @param plist
5765      *            IN: Identifier of property list to query.
5766      * @param ik
5767      *            OUT: Pointer to location to return the chunked storage B-tree 1/2 rank.
5768      *
5769      * @return a non-negative value if successful
5770      *
5771      * @exception HDF5LibraryException
5772      *                - Error from the HDF-5 Library.
5773      * @exception NullPointerException
5774      *                - ik array is null.
5775      **/
H5Pget_istore_k(long plist, int[] ik)5776     public synchronized static native int H5Pget_istore_k(long plist, int[] ik) throws HDF5LibraryException,
5777     NullPointerException;
5778 
5779     /**
5780      * H5Pset_istore_k sets the size of the parameter used to control the B-trees for indexing chunked datasets.
5781      *
5782      * @param plist
5783      *            IN: Identifier of property list to query.
5784      * @param ik
5785      *            IN: 1/2 rank of chunked storage B-tree.
5786      *
5787      * @return a non-negative value if successful
5788      *
5789      * @exception HDF5LibraryException
5790      *                - Error from the HDF-5 Library.
5791      **/
H5Pset_istore_k(long plist, int ik)5792     public synchronized static native int H5Pset_istore_k(long plist, int ik) throws HDF5LibraryException;
5793 
5794     /**
5795      * H5Pget_shared_mesg_nindexes retrieves number of shared object header message indexes in file creation property
5796      * list.
5797      *
5798      * @param fcpl_id
5799      *            IN: : File creation property list identifier
5800      *
5801      * @return nindexes, the number of shared object header message indexes available in files created with this
5802      *         property list
5803      *
5804      * @exception HDF5LibraryException
5805      *                - Error from the HDF-5 Library.
5806      *
5807      **/
H5Pget_shared_mesg_nindexes(long fcpl_id)5808     public synchronized static native int H5Pget_shared_mesg_nindexes(long fcpl_id) throws HDF5LibraryException;
5809 
5810     /**
5811      * H5Pset_shared_mesg_nindexes sets the number of shared object header message indexes in the specified file
5812      * creation property list.
5813      *
5814      * @param plist_id
5815      *            IN: File creation property list
5816      * @param nindexes
5817      *            IN: Number of shared object header message indexes to be available in files created with this property
5818      *            list
5819      *
5820      * @return a non-negative value if successful; otherwise returns a negative value.
5821      *
5822      * @exception HDF5LibraryException
5823      *                - Error from the HDF-5 Library.
5824      * @exception IllegalArgumentException
5825      *                - Invalid value of nindexes
5826      *
5827      **/
H5Pset_shared_mesg_nindexes(long plist_id, int nindexes)5828     public synchronized static native int H5Pset_shared_mesg_nindexes(long plist_id, int nindexes)
5829             throws HDF5LibraryException, IllegalArgumentException;
5830 
5831     /**
5832      * H5Pget_shared_mesg_index Retrieves the configuration settings for a shared message index.
5833      *
5834      * @param fcpl_id
5835      *            IN: File creation property list identifier
5836      * @param index_num
5837      *            IN: Index being configured.
5838      * @param mesg_info
5839      *            The message type and minimum message size
5840      *
5841      *            <pre>
5842      *      mesg_info[0] =  Types of messages that may be stored in this index.
5843      *      mesg_info[1] =  Minimum message size.
5844      * </pre>
5845      *
5846      * @return Returns a non-negative value if successful; otherwise returns a negative value.
5847      *
5848      * @exception HDF5LibraryException
5849      *                - Error from the HDF-5 Library.
5850      * @exception NullPointerException
5851      *                - mesg_info is null.
5852      * @exception IllegalArgumentException
5853      *                - Invalid value of nindexes
5854      *
5855      **/
H5Pget_shared_mesg_index(long fcpl_id, int index_num, int[] mesg_info)5856     public synchronized static native int H5Pget_shared_mesg_index(long fcpl_id, int index_num, int[] mesg_info)
5857             throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
5858 
5859     /**
5860      * H5Pset_shared_mesg_index Configures the specified shared object header message index
5861      *
5862      * @param fcpl_id
5863      *            IN: File creation property list identifier.
5864      * @param index_num
5865      *            IN: Index being configured.
5866      * @param mesg_type_flags
5867      *            IN: Types of messages that should be stored in this index.
5868      * @param min_mesg_size
5869      *            IN: Minimum message size.
5870      *
5871      * @return a non-negative value if successful; otherwise returns a negative value.
5872      *
5873      * @exception HDF5LibraryException
5874      *                - Error from the HDF-5 Library.
5875      * @exception IllegalArgumentException
5876      *                - Invalid value of nindexes
5877      *
5878      **/
H5Pset_shared_mesg_index(long fcpl_id, int index_num, int mesg_type_flags, int min_mesg_size)5879     public synchronized static native int H5Pset_shared_mesg_index(long fcpl_id, int index_num, int mesg_type_flags,
5880             int min_mesg_size) throws HDF5LibraryException, IllegalArgumentException;
5881 
5882     /**
5883      * H5Pget_shared_mesg_phase_change retrieves shared object header message phase change information.
5884      *
5885      * @param fcpl_id
5886      *            IN: : File creation property list identifier
5887      * @param size
5888      *            The threshold values for storage of shared object header message indexes in a file.
5889      *
5890      *            <pre>
5891      *      size[0] =  Threshold above which storage of a shared object header message index shifts from list to B-tree
5892      *      size[1] =  Threshold below which storage of a shared object header message index reverts to list format
5893      * </pre>
5894      *
5895      * @return Returns a non-negative value if successful; otherwise returns a negative value.
5896      *
5897      * @exception HDF5LibraryException
5898      *                - Error from the HDF-5 Library.
5899      * @exception NullPointerException
5900      *                - size is null.
5901      *
5902      **/
H5Pget_shared_mesg_phase_change(long fcpl_id, int[] size)5903     public synchronized static native int H5Pget_shared_mesg_phase_change(long fcpl_id, int[] size)
5904             throws HDF5LibraryException, NullPointerException;
5905 
5906     /**
5907      * H5Pset_shared_mesg_phase_change sets shared object header message storage phase change thresholds.
5908      *
5909      * @param fcpl_id
5910      *            IN: File creation property list identifier
5911      * @param max_list
5912      *            IN: Threshold above which storage of a shared object header message index shifts from list to B-tree
5913      * @param min_btree
5914      *            IN: Threshold below which storage of a shared object header message index reverts to list format
5915      *
5916      * @return a non-negative value if successful; otherwise returns a negative value.
5917      *
5918      * @exception HDF5LibraryException
5919      *                - Error from the HDF-5 Library.
5920      * @exception IllegalArgumentException
5921      *                - Invalid values of max_list and min_btree.
5922      *
5923      **/
H5Pset_shared_mesg_phase_change(long fcpl_id, int max_list, int min_btree)5924     public synchronized static native int H5Pset_shared_mesg_phase_change(long fcpl_id, int max_list, int min_btree)
5925             throws HDF5LibraryException, IllegalArgumentException;
5926 
5927     /**
5928      * H5Pset_file_space_strategy sets the file space management strategy for the file associated with fcpl_id to strategy.
5929      * There are four strategies that applications can select and they are described in the Parameters section.
5930      *
5931      * @param fcpl_id
5932      *            IN: File creation property list identifier
5933      * @param strategy
5934      *            IN: The strategy for file space management.
5935      *                H5F_FSPACE_STRATEGY_FSM_AGGR
5936      *                        Mechanisms: free-space managers, aggregators, and virtual file drivers
5937      *                        This is the library default when not set.
5938      *                H5F_FSPACE_STRATEGY_PAGE
5939      *                        Mechanisms: free-space managers with embedded paged aggregation and virtual file drivers
5940      *                H5F_FSPACE_STRATEGY_AGGR
5941      *                        Mechanisms: aggregators and virtual file drivers
5942      *                H5F_FSPACE_STRATEGY_NONE
5943      *                        Mechanisms: virtual file drivers
5944      * @param persist
5945      *            IN: True to persist free-space.
5946      * @param threshold
5947      *            IN: The free-space section threshold. The library default is 1, which is to track all free-space sections.
5948      *                Passing a value of zero (0) indicates that the value of threshold is not to be modified.
5949      *
5950      * @exception HDF5LibraryException
5951      *                - Error from the HDF-5 Library.
5952      * @exception IllegalArgumentException
5953      *                - Invalid values of max_list and min_btree.
5954      *
5955      **/
H5Pset_file_space_strategy(long fcpl_id, int strategy, boolean persist, long threshold)5956     public synchronized static native void H5Pset_file_space_strategy(long fcpl_id, int strategy, boolean persist, long threshold)
5957             throws HDF5LibraryException, IllegalArgumentException;
5958 
5959     /**
5960      * H5Pget_file_space_strategy provides the means for applications to manage the HDF5 file's file space strategy for their specific needs.
5961      *
5962      * @param fcpl_id
5963      *            IN: File creation property list identifier
5964      * @param persist
5965      *            IN/OUT: The current free-space persistence. NULL, persist not queried.
5966      * @param threshold
5967      *            IN/OUT: The current free-space section threshold. NULL, threshold not queried.
5968      *
5969      * @return the current free-space strategy.
5970      *
5971      * @exception HDF5LibraryException
5972      *                - Error from the HDF-5 Library.
5973      * @exception IllegalArgumentException
5974      *                - Invalid values of max_list and min_btree.
5975      *
5976      **/
H5Pget_file_space_strategy(long fcpl_id, boolean[] persist, long[] threshold)5977     public synchronized static native int H5Pget_file_space_strategy(long fcpl_id, boolean[] persist, long[] threshold)
5978             throws HDF5LibraryException, IllegalArgumentException;
5979 
5980     /**
5981      * H5Pget_file_space_strategy_persist provides the means for applications to manage the HDF5 file's file space strategy for their specific needs.
5982      *
5983      * @param fcpl_id
5984      *            IN: File creation property list identifier
5985      *
5986      * @return the current free-space persistence.
5987      *
5988      * @exception HDF5LibraryException
5989      *                - Error from the HDF-5 Library.
5990      * @exception IllegalArgumentException
5991      *                - Invalid values of max_list and min_btree.
5992      *
5993      **/
H5Pget_file_space_strategy_persist(long fcpl_id)5994     public synchronized static native boolean H5Pget_file_space_strategy_persist(long fcpl_id)
5995             throws HDF5LibraryException, IllegalArgumentException;
5996 
5997     /**
5998      * H5Pget_file_space_strategy_threshold provides the means for applications to manage the HDF5 file's file space strategy for their specific needs.
5999      *
6000      * @param fcpl_id
6001      *            IN: File creation property list identifier
6002      *
6003      * @return the current free-space section threshold.
6004      *
6005      * @exception HDF5LibraryException
6006      *                - Error from the HDF-5 Library.
6007      * @exception IllegalArgumentException
6008      *                - Invalid values of max_list and min_btree.
6009      *
6010      **/
H5Pget_file_space_strategy_threshold(long fcpl_id)6011    public synchronized static native long H5Pget_file_space_strategy_threshold(long fcpl_id)
6012             throws HDF5LibraryException, IllegalArgumentException;
6013 
6014    /**
6015     * H5Pset_file_space_page_size retrieves the file space page size for aggregating small metadata or raw data.
6016     *
6017     * @param fcpl_id
6018     *            IN: File creation property list identifier
6019     * @param page_size
6020     *            IN: the file space page size.
6021     *
6022     *
6023     * @exception HDF5LibraryException
6024     *                - Error from the HDF-5 Library.
6025     * @exception IllegalArgumentException
6026     *                - Invalid values of max_list and min_btree.
6027     *
6028     **/
H5Pset_file_space_page_size(long fcpl_id, long page_size)6029   public synchronized static native void H5Pset_file_space_page_size(long fcpl_id, long page_size)
6030            throws HDF5LibraryException, IllegalArgumentException;
6031 
6032    /**
6033     * H5Pget_file_space_page_size Sets the file space page size for paged aggregation.
6034     *
6035     * @param fcpl_id
6036     *            IN: File creation property list identifier
6037     *
6038     * @return the current file space page size.
6039     *
6040     * @exception HDF5LibraryException
6041     *                - Error from the HDF-5 Library.
6042     * @exception IllegalArgumentException
6043     *                - Invalid values of max_list and min_btree.
6044     *
6045     **/
H5Pget_file_space_page_size(long fcpl_id)6046   public synchronized static native long H5Pget_file_space_page_size(long fcpl_id)
6047            throws HDF5LibraryException, IllegalArgumentException;
6048 
6049 
6050     // /////// File access property list (FAPL) routines ///////
6051 
6052     /**
6053      * H5Pget_alignment retrieves the current settings for alignment properties from a file access property list.
6054      *
6055      * @param plist
6056      *            IN: Identifier of a file access property list.
6057      * @param alignment
6058      *            OUT: threshold value and alignment value.
6059      *
6060      *            <pre>
6061      *      alignment[0] = threshold // threshold value
6062      *      alignment[1] = alignment // alignment value
6063      * </pre>
6064      * @return a non-negative value if successful
6065      *
6066      * @exception HDF5LibraryException
6067      *                - Error from the HDF-5 Library.
6068      * @exception NullPointerException
6069      *                - aligment array is null.
6070      * @exception IllegalArgumentException
6071      *                - aligment array is invalid.
6072      **/
H5Pget_alignment(long plist, long[] alignment)6073     public synchronized static native int H5Pget_alignment(long plist, long[] alignment) throws HDF5LibraryException,
6074     NullPointerException, IllegalArgumentException;
6075 
6076     /**
6077      * H5Pset_alignment sets the alignment properties of a file access property list so that any file object &gt;=
6078      * THRESHOLD bytes will be aligned on an address which is a multiple of ALIGNMENT.
6079      *
6080      * @param plist
6081      *            IN: Identifier for a file access property list.
6082      * @param threshold
6083      *            IN: Threshold value.
6084      * @param alignment
6085      *            IN: Alignment value.
6086      *
6087      * @return a non-negative value if successful
6088      *
6089      * @exception HDF5LibraryException
6090      *                - Error from the HDF-5 Library.
6091      **/
H5Pset_alignment(long plist, long threshold, long alignment)6092     public synchronized static native int H5Pset_alignment(long plist, long threshold, long alignment)
6093             throws HDF5LibraryException;
6094 
6095     /**
6096      * H5Pget_driver returns the identifier of the low-level file driver associated with the file access property list
6097      * or data transfer property list plid.
6098      *
6099      * @param plid
6100      *            IN: File access or data transfer property list identifier.
6101      * @return a valid low-level driver identifier if successful; a negative value if failed
6102      *
6103      * @exception HDF5LibraryException
6104      *                - Error from the HDF-5 Library.
6105      */
H5Pget_driver(long plid)6106     public synchronized static native long H5Pget_driver(long plid) throws HDF5LibraryException;
6107 
H5Pget_family_offset(long fapl_id)6108     public synchronized static native long H5Pget_family_offset(long fapl_id) throws HDF5LibraryException,
6109     NullPointerException;
6110 
H5Pset_family_offset(long fapl_id, long offset)6111     public synchronized static native int H5Pset_family_offset(long fapl_id, long offset) throws HDF5LibraryException,
6112     NullPointerException;
6113 
6114     /**
6115      * Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes
6116      * and the RDCC_W0 value in the raw data chunk cache.
6117      *
6118      * @param plist
6119      *            IN: Identifier of the file access property list.
6120      * @param mdc_nelmts
6121      *            IN/OUT: No longer used, will be ignored.
6122      * @param rdcc_nelmts
6123      *            IN/OUT: Number of elements (objects) in the raw data chunk cache.
6124      * @param rdcc_nbytes
6125      *            IN/OUT: Total size of the raw data chunk cache, in bytes.
6126      * @param rdcc_w0
6127      *            IN/OUT: Preemption policy.
6128      *
6129      * @return a non-negative value if successful
6130      *
6131      * @exception HDF5LibraryException
6132      *                - Error from the HDF-5 Library.
6133      * @exception NullPointerException
6134      *                - an array is null.
6135      **/
H5Pget_cache(long plist, int[] mdc_nelmts, long[] rdcc_nelmts, long[] rdcc_nbytes, double[] rdcc_w0)6136     public synchronized static native int H5Pget_cache(long plist, int[] mdc_nelmts, long[] rdcc_nelmts,
6137             long[] rdcc_nbytes, double[] rdcc_w0) throws HDF5LibraryException, NullPointerException;
6138 
6139     /**
6140      * H5Pset_cache sets the number of elements (objects) in the meta data cache and the total number of bytes in the
6141      * raw data chunk cache.
6142      *
6143      * @param plist
6144      *            IN: Identifier of the file access property list.
6145      * @param mdc_nelmts
6146      *            IN: No longer used, will be ignored.
6147      * @param rdcc_nelmts
6148      *            IN: Number of elements (objects) in the raw data chunk cache.
6149      * @param rdcc_nbytes
6150      *            IN: Total size of the raw data chunk cache, in bytes.
6151      * @param rdcc_w0
6152      *            IN: Preemption policy.
6153      *
6154      * @return a non-negative value if successful
6155      *
6156      * @exception HDF5LibraryException
6157      *                - Error from the HDF-5 Library.
6158      **/
H5Pset_cache(long plist, int mdc_nelmts, long rdcc_nelmts, long rdcc_nbytes, double rdcc_w0)6159     public synchronized static native int H5Pset_cache(long plist, int mdc_nelmts, long rdcc_nelmts, long rdcc_nbytes,
6160             double rdcc_w0) throws HDF5LibraryException;
6161 
6162     /**
6163      * H5Pget_mdc_config gets the initial metadata cache configuration contained in a file access property list and
6164      * loads it into the instance of H5AC_cache_config_t pointed to by the config_ptr parameter. This configuration is
6165      * used when the file is opened.
6166      *
6167      * @param plist_id
6168      *            IN: Identifier of the file access property list.
6169      *
6170      * @return A buffer(H5AC_cache_config_t) for the current metadata cache configuration information
6171      *
6172      * @exception HDF5LibraryException
6173      *                - Error from the HDF-5 Library.
6174      **/
H5Pget_mdc_config(long plist_id)6175     public synchronized static native H5AC_cache_config_t H5Pget_mdc_config(long plist_id) throws HDF5LibraryException;
6176 
H5Pset_mdc_config(long plist_id, H5AC_cache_config_t config_ptr)6177     public synchronized static native void H5Pset_mdc_config(long plist_id, H5AC_cache_config_t config_ptr)
6178             throws HDF5LibraryException;
6179 
6180     /**
6181      * H5Pget_gc_references Returns the current setting for the garbage collection refernces property from a file access
6182      * property list.
6183      *
6184      * @param fapl_id
6185      *            IN File access property list
6186      *
6187      * @return GC is on (true) or off (false)
6188      *
6189      * @exception HDF5LibraryException
6190      *                - Error from the HDF-5 Library.
6191      **/
H5Pget_gc_references(long fapl_id)6192     public synchronized static native boolean H5Pget_gc_references(long fapl_id) throws HDF5LibraryException;
6193 
6194     /**
6195      * H5Pset_gc_references Sets the flag for garbage collecting references for the file. Default value for garbage
6196      * collecting references is off.
6197      *
6198      * @param fapl_id
6199      *            IN File access property list
6200      * @param gc_ref
6201      *            IN set GC on (true) or off (false)
6202      *
6203      * @return non-negative if successful
6204      *
6205      * @exception HDF5LibraryException
6206      *                - Error from the HDF-5 Library.
6207      **/
H5Pset_gc_references(long fapl_id, boolean gc_ref)6208     public synchronized static native int H5Pset_gc_references(long fapl_id, boolean gc_ref)
6209             throws HDF5LibraryException;
6210 
H5Pget_fclose_degree(long plist_id)6211     public synchronized static native int H5Pget_fclose_degree(long plist_id) throws HDF5LibraryException,
6212     NullPointerException;
6213 
H5Pset_fclose_degree(long plist, int degree)6214     public synchronized static native int H5Pset_fclose_degree(long plist, int degree) throws HDF5LibraryException,
6215     NullPointerException;
6216 
6217     /**
6218      * H5Pget_meta_block_size the current metadata block size setting.
6219      *
6220      * @param fapl_id
6221      *            IN: File access property list identifier
6222      *
6223      * @return the minimum size, in bytes, of metadata block allocations.
6224      *
6225      * @exception HDF5LibraryException
6226      *                - Error from the HDF-5 Library.
6227      *
6228      **/
H5Pget_meta_block_size(long fapl_id)6229     public synchronized static native long H5Pget_meta_block_size(long fapl_id) throws HDF5LibraryException;
6230 
6231     /**
6232      * H5Pset_meta_block_size sets the minimum metadata block size.
6233      *
6234      * @param fapl_id
6235      *            IN: File access property list identifier
6236      * @param size
6237      *            IN: Minimum size, in bytes, of metadata block allocations.
6238      *
6239      * @exception HDF5LibraryException
6240      *                - Error from the HDF-5 Library.
6241      *
6242      **/
H5Pset_meta_block_size(long fapl_id, long size)6243     public synchronized static native void H5Pset_meta_block_size(long fapl_id, long size) throws HDF5LibraryException;
6244 
H5Pget_sieve_buf_size(long fapl_id)6245     public synchronized static native long H5Pget_sieve_buf_size(long fapl_id) throws HDF5LibraryException;
6246 
H5Pset_sieve_buf_size(long fapl_id, long size)6247     public synchronized static native void H5Pset_sieve_buf_size(long fapl_id, long size) throws HDF5LibraryException;
6248 
6249     /**
6250      * H5Pget_small_data_block_size retrieves the size of a block of small data in a file creation property list.
6251      *
6252      * @param plist
6253      *            IN: Identifier for property list to query.
6254      *
6255      * @return a non-negative value and the size of the user block; if successful
6256      *
6257      * @exception HDF5LibraryException
6258      *                - Error from the HDF-5 Library.
6259      **/
H5Pget_small_data_block_size(long plist)6260     public synchronized static native long H5Pget_small_data_block_size(long plist) throws HDF5LibraryException;
6261 
6262     /**
6263      * H5Pset_small_data_block_size reserves blocks of size bytes for the contiguous storage of the raw data portion of
6264      * small datasets.
6265      *
6266      * @param plist
6267      *            IN: Identifier of property list to modify.
6268      * @param size
6269      *            IN: Size of the blocks in bytes.
6270      *
6271      * @return a non-negative value if successful
6272      *
6273      * @exception HDF5LibraryException
6274      *                - Error from the HDF-5 Library.
6275      **/
H5Pset_small_data_block_size(long plist, long size)6276     public synchronized static native int H5Pset_small_data_block_size(long plist, long size)
6277             throws HDF5LibraryException;
6278 
6279     /**
6280      * H5Pget_libver_bounds retrieves the lower and upper bounds on the HDF5 Library versions that indirectly determine
6281      * the object formats versions used when creating objects in the file.
6282      *
6283      * @param fapl_id
6284      *            IN: File access property list identifier
6285      * @param libver
6286      *            The earliest/latest version of the library that will be used for writing objects.
6287      *
6288      *            <pre>
6289      *      libver[0] =  The earliest version of the library that will be used for writing objects
6290      *      libver[1] =  The latest version of the library that will be used for writing objects.
6291      * </pre>
6292      *
6293      * @return Returns a non-negative value if successful; otherwise returns a negative value.
6294      *
6295      * @exception HDF5LibraryException
6296      *                - Error from the HDF-5 Library.
6297      * @exception NullPointerException
6298      *                - size is null.
6299      *
6300      **/
H5Pget_libver_bounds(long fapl_id, int[] libver)6301     public synchronized static native int H5Pget_libver_bounds(long fapl_id, int[] libver) throws HDF5LibraryException,
6302     NullPointerException;
6303 
6304     /**
6305      * H5Pset_libver_bounds Sets bounds on library versions, and indirectly format versions, to be used when creating
6306      * objects
6307      *
6308      * @param fapl_id
6309      *            IN: File access property list identifier
6310      * @param low
6311      *            IN: The earliest version of the library that will be used for writing objects
6312      * @param high
6313      *            IN: The latest version of the library that will be used for writing objects.
6314      *
6315      *
6316      * @return Returns a non-negative value if successful; otherwise returns a negative value.
6317      *
6318      * @exception HDF5LibraryException
6319      *                - Error from the HDF-5 Library.
6320      * @exception IllegalArgumentException
6321      *                - Argument is Illegal
6322      *
6323      **/
H5Pset_libver_bounds(long fapl_id, int low, int high)6324     public synchronized static native int H5Pset_libver_bounds(long fapl_id, int low, int high)
6325             throws HDF5LibraryException, IllegalArgumentException;
6326 
6327     /**
6328      * H5Pget_elink_file_cache_size retrieves the size of the external link open file cache.
6329      *
6330      * @param fapl_id
6331      *            IN: File access property list identifier
6332      *
6333      * @return External link open file cache size in number of files.
6334      *
6335      * @exception HDF5LibraryException
6336      *                - Error from the HDF-5 Library.
6337      *
6338      **/
H5Pget_elink_file_cache_size(long fapl_id)6339     public synchronized static native int H5Pget_elink_file_cache_size(long fapl_id) throws HDF5LibraryException;
6340 
6341     /**
6342      * H5Pset_elink_file_cache_size sets the number of files that can be held open in an external link open file cache.
6343      *
6344      * @param fapl_id
6345      *            IN: File access property list identifier
6346      * @param efc_size
6347      *            IN: External link open file cache size in number of files.
6348      *
6349      * @exception HDF5LibraryException
6350      *                - Error from the HDF-5 Library.
6351      *
6352      **/
H5Pset_elink_file_cache_size(long fapl_id, int efc_size)6353     public synchronized static native void H5Pset_elink_file_cache_size(long fapl_id, int efc_size)
6354             throws HDF5LibraryException;
6355 
6356     /**
6357      * H5Pset_mdc_log_options sets metadata cache logging options.
6358      *
6359      * @param fapl_id
6360      *            IN: File access property list identifier
6361      * @param is_enabled
6362      *            IN: Whether logging is enabled.
6363      * @param location
6364      *            IN: Location of log in UTF-8/ASCII (file path/name) (On Windows, this must be ASCII).
6365      * @param start_on_access
6366      *            IN: Whether the logging begins as soon as the file is opened or created.
6367      *
6368      * @exception HDF5LibraryException
6369      *                - Error from the HDF-5 Library.
6370      * @exception NullPointerException
6371      *                - location is null.
6372      *
6373      **/
H5Pset_mdc_log_options(long fapl_id, boolean is_enabled, String location, boolean start_on_access)6374     public synchronized static native void H5Pset_mdc_log_options(long fapl_id, boolean is_enabled, String location, boolean start_on_access)
6375             throws HDF5LibraryException, NullPointerException;
6376 
6377     /**
6378      * H5Pget_mdc_log_options gets metadata cache logging options.
6379      *
6380      * @param fapl_id
6381      *            IN: File access property list identifier
6382      * @param mdc_log_options
6383      *         the options
6384      *             mdc_logging_options[0] = is_enabled, whether logging is enabled
6385      *             mdc_logging_options[1] = start_on_access, whether the logging begins as soon as the file is opened or created
6386      *
6387      * @return the location of log in UTF-8/ASCII (file path/name) (On Windows, this must be ASCII).
6388      *
6389      * @exception HDF5LibraryException
6390      *                - Error from the HDF-5 Library.
6391      *
6392      **/
H5Pget_mdc_log_options(long fapl_id, boolean[] mdc_log_options)6393     public synchronized static native String H5Pget_mdc_log_options(long fapl_id, boolean[] mdc_log_options)
6394             throws HDF5LibraryException;
6395 
6396     /**
6397      * H5Pget_metadata_read_attempts retrieves the number of read attempts that is set in the file access property list plist_id.
6398      *
6399      * @param plist_id
6400      *            IN: File access property list identifier
6401      *
6402      * @return The number of read attempts.
6403      *
6404      * @exception HDF5LibraryException
6405      *                - Error from the HDF-5 Library.
6406      *
6407      **/
H5Pget_metadata_read_attempts(long plist_id)6408     public synchronized static native long H5Pget_metadata_read_attempts(long plist_id) throws HDF5LibraryException;
6409 
6410     /**
6411      * H5Pset_metadata_read_attempts sets the number of reads that the library will try when reading checksummed
6412      * metadata in an HDF5 file opened with SWMR access. When reading such metadata, the library will compare the
6413      * checksum computed for the metadata just read with the checksum stored within the piece of checksum. When
6414      * performing SWMR operations on a file, the checksum check might fail when the library reads data on a system
6415      * that is not atomic. To remedy such situations, the library will repeatedly read the piece of metadata until
6416      * the check passes or finally fails the read when the allowed number of attempts is reached.
6417      *
6418      * @param plist_id
6419      *            IN: File access property list identifier
6420      * @param attempts
6421      *            IN: The number of read attempts which is a value greater than 0.
6422      *
6423      * @exception HDF5LibraryException
6424      *                - Error from the HDF-5 Library.
6425      *
6426      **/
H5Pset_metadata_read_attempts(long plist_id, long attempts)6427     public synchronized static native void H5Pset_metadata_read_attempts(long plist_id, long attempts)
6428             throws HDF5LibraryException;
6429 
6430     /**
6431      * H5Pget_evict_on_close retrieves the file access property list setting that determines whether an HDF5 object
6432      * will be evicted from the library's metadata cache when it is closed.
6433      *
6434      * @param fapl_id
6435      *            IN: File access property list identifier
6436      *
6437      * @return indication if the object will be evicted on close.
6438      *
6439      * @exception HDF5LibraryException
6440      *                - Error from the HDF-5 Library.
6441      *
6442      **/
H5Pget_evict_on_close(long fapl_id)6443     public synchronized static native boolean H5Pget_evict_on_close(long fapl_id)
6444             throws HDF5LibraryException;
6445 
6446     /**
6447      * H5Pset_evict_on_close controls the library's behavior of evicting metadata associated with a closed object.
6448      *
6449      * @param fapl_id
6450      *            IN: File access property list identifier
6451      * @param evict_on_close
6452      *            IN: Whether the HDF5 object should be evicted on close.
6453      *
6454      * @exception HDF5LibraryException
6455      *                - Error from the HDF-5 Library.
6456      *
6457      **/
H5Pset_evict_on_close(long fapl_id, boolean evict_on_close)6458     public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close)
6459             throws HDF5LibraryException;
6460 
6461     // Dataset creation property list (DCPL) routines //
6462 
6463     /**
6464      * H5Pget_layout returns the layout of the raw data for a dataset.
6465      *
6466      * @param plist
6467      *            IN: Identifier for property list to query.
6468      *
6469      * @return the layout type of a dataset creation property list if successful. Otherwise returns H5D_LAYOUT_ERROR
6470      *         (-1).
6471      *
6472      * @exception HDF5LibraryException
6473      *                - Error from the HDF-5 Library.
6474      **/
H5Pget_layout(long plist)6475     public synchronized static native int H5Pget_layout(long plist) throws HDF5LibraryException;
6476 
6477     /**
6478      * H5Pset_layout sets the type of storage used store the raw data for a dataset.
6479      *
6480      * @param plist
6481      *            IN: Identifier of property list to query.
6482      * @param layout
6483      *            IN: Type of storage layout for raw data.
6484      *
6485      * @return a non-negative value if successful
6486      *
6487      * @exception HDF5LibraryException
6488      *                - Error from the HDF-5 Library.
6489      **/
H5Pset_layout(long plist, int layout)6490     public synchronized static native int H5Pset_layout(long plist, int layout) throws HDF5LibraryException;
6491 
6492     /**
6493      * H5Pget_chunk retrieves the size of chunks for the raw data of a chunked layout dataset.
6494      *
6495      * @param plist
6496      *            IN: Identifier of property list to query.
6497      * @param max_ndims
6498      *            IN: Size of the dims array.
6499      * @param dims
6500      *            OUT: Array to store the chunk dimensions.
6501      *
6502      * @return chunk dimensionality successful
6503      *
6504      * @exception HDF5LibraryException
6505      *                - Error from the HDF-5 Library.
6506      * @exception NullPointerException
6507      *                - dims array is null.
6508      * @exception IllegalArgumentException
6509      *                - max_ndims &lt;=0
6510      **/
H5Pget_chunk(long plist, int max_ndims, long[] dims)6511     public synchronized static native int H5Pget_chunk(long plist, int max_ndims, long[] dims)
6512             throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
6513 
6514     /**
6515      * H5Pset_chunk sets the size of the chunks used to store a chunked layout dataset.
6516      *
6517      * @param plist
6518      *            IN: Identifier for property list to query.
6519      * @param ndims
6520      *            IN: The number of dimensions of each chunk.
6521      * @param dim
6522      *            IN: An array containing the size of each chunk.
6523      *
6524      * @return a non-negative value if successful
6525      *
6526      * @exception HDF5LibraryException
6527      *                - Error from the HDF-5 Library.
6528      * @exception NullPointerException
6529      *                - dims array is null.
6530      * @exception IllegalArgumentException
6531      *                - dims &lt;=0
6532      **/
H5Pset_chunk(long plist, int ndims, byte[] dim)6533     public synchronized static native int H5Pset_chunk(long plist, int ndims, byte[] dim) throws HDF5LibraryException,
6534     NullPointerException, IllegalArgumentException;
6535 
H5Pset_chunk(long plist, int ndims, long[] dim)6536     public synchronized static int H5Pset_chunk(long plist, int ndims, long[] dim) throws HDF5Exception,
6537     NullPointerException, IllegalArgumentException {
6538         if (dim == null) {
6539             return -1;
6540         }
6541 
6542         HDFArray theArray = new HDFArray(dim);
6543         byte[] thedims = theArray.byteify();
6544 
6545         int retVal = H5Pset_chunk(plist, ndims, thedims);
6546 
6547         thedims = null;
6548         theArray = null;
6549         return retVal;
6550     }
6551 
6552     /**
6553      * H5Pset_virtual maps elements of the virtual dataset (VDS) described by the
6554      * virtual dataspace identifier vspace_id to the elements of the source dataset
6555      * described by the source dataset dataspace identifier src_space_id. The source
6556      * dataset is identified by the name of the file where it is located, src_file_name,
6557      * and the name of the dataset, src_dset_name.
6558      *
6559      * @param dcpl_id
6560      *            IN: The identifier of the dataset creation property list that will be used when creating the virtual dataset.
6561      * @param vspace_id
6562      *            IN: The dataspace identifier with the selection within the virtual dataset applied, possibly an unlimited selection.
6563      * @param src_file_name
6564      *            IN: The name of the HDF5 file where the source dataset is located. The file might not exist yet. The name can be specified using a C-style printf statement.
6565      * @param src_dset_name
6566      *            IN: The path to the HDF5 dataset in the file specified by src_file_name. The dataset might not exist yet. The dataset name can be specified using a C-style printf statement.
6567      * @param src_space_id
6568      *            IN: The source dataset dataspace identifier with a selection applied, possibly an unlimited selection.
6569      *
6570      * @exception HDF5LibraryException
6571      *                - Error from the HDF-5 Library.
6572      * @exception NullPointerException
6573      *                - an name string is null.
6574      * @exception IllegalArgumentException
6575      *                - An id is &lt;=0
6576      **/
H5Pset_virtual(long dcpl_id, long vspace_id, String src_file_name, String src_dset_name, long src_space_id)6577     public synchronized static native void H5Pset_virtual(long dcpl_id, long vspace_id, String src_file_name, String src_dset_name, long src_space_id) throws HDF5LibraryException,
6578     NullPointerException, IllegalArgumentException;
6579 
6580     /**
6581      * H5Pget_virtual_count gets the number of mappings for a virtual dataset that has the creation property list specified by dcpl_id.
6582      *
6583      * @param dcpl_id
6584      *            IN: The identifier of the virtual dataset creation property list.
6585      *
6586      * @return a non-negative number of mappings if successful
6587      *
6588      * @exception HDF5LibraryException
6589      *                - Error from the HDF-5 Library.
6590      * @exception IllegalArgumentException
6591      *                - An id is &lt;=0
6592      **/
H5Pget_virtual_count(long dcpl_id)6593     public synchronized static native long H5Pget_virtual_count(long dcpl_id) throws HDF5LibraryException, IllegalArgumentException;
6594 
6595     /**
6596      * H5Pget_virtual_vspace takes the dataset creation property list for the virtual dataset, dcpl_id, and the mapping index, index,
6597      *     and returns a dataspace identifier for the selection within the virtual dataset used in the mapping.
6598      *
6599      * @param dcpl_id
6600      *            IN: The identifier of the virtual dataset creation property list.
6601      * @param index
6602      *            IN: Mapping index.
6603      *
6604      * @return a valid dataspace identifier if successful
6605      *
6606      * @exception HDF5LibraryException
6607      *                - Error from the HDF-5 Library.
6608      * @exception IllegalArgumentException
6609      *                - An id is &lt;=0
6610      **/
H5Pget_virtual_vspace(long dcpl_id, long index)6611     public synchronized static native long H5Pget_virtual_vspace(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException;
6612 
6613     /**
6614      * H5Pget_virtual_srcspace takes the dataset creation property list for the virtual dataset, dcpl_id, and the mapping index, index,
6615      *    and returns a dataspace identifier for the selection within the source dataset used in the mapping.
6616      *
6617      * @param dcpl_id
6618      *            IN: The identifier of the virtual dataset creation property list.
6619      * @param index
6620      *            IN: Mapping index.
6621      *
6622      * @return a valid dataspace identifier if successful
6623      *
6624      * @exception HDF5LibraryException
6625      *                - Error from the HDF-5 Library.
6626      * @exception IllegalArgumentException
6627      *                - An id is &lt;=0
6628      **/
H5Pget_virtual_srcspace(long dcpl_id, long index)6629     public synchronized static native long H5Pget_virtual_srcspace(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException;
6630 
6631     /**
6632      * H5Pget_virtual_filename takes the dataset creation property list for the virtual dataset, dcpl_id, the mapping index, index,
6633      * the size of the filename for a source dataset, size, and retrieves the name of the file for a source dataset used in the mapping.
6634      *
6635      * @param dcpl_id
6636      *            IN: The identifier of the virtual dataset creation property list.
6637      * @param index
6638      *            IN: Mapping index.
6639      *
6640      * @return the name of the file containing the source dataset if successful
6641      *
6642      * @exception HDF5LibraryException
6643      *                - Error from the HDF-5 Library.
6644      * @exception IllegalArgumentException
6645      *                - An id is &lt;=0
6646      **/
H5Pget_virtual_filename(long dcpl_id, long index)6647     public synchronized static native String H5Pget_virtual_filename(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException;
6648 
6649     /**
6650      * H5Pget_virtual_dsetname takes the dataset creation property list for the virtual dataset, dcpl_id, the mapping index, index, the
6651      * size of the dataset name for a source dataset, size, and retrieves the name of the source dataset used in the mapping.
6652      *
6653      * @param dcpl_id
6654      *            IN: The identifier of the virtual dataset creation property list.
6655      * @param index
6656      *            IN: Mapping index.
6657      *
6658      * @return the name of the source dataset if successful
6659      *
6660      * @exception HDF5LibraryException
6661      *                - Error from the HDF-5 Library.
6662      * @exception IllegalArgumentException
6663      *                - An id is &lt;=0
6664      **/
H5Pget_virtual_dsetname(long dcpl_id, long index)6665     public synchronized static native String H5Pget_virtual_dsetname(long dcpl_id, long index) throws HDF5LibraryException, IllegalArgumentException;
6666 
6667 //    /////  unimplemented /////
6668 //    /**
6669 //     * H5Pget_vds_file_cache_size retrieves the size of the vds link open file cache.
6670 //     *
6671 //     * @param fapl_id
6672 //     *            IN: File access property list identifier
6673 //     *
6674 //     * @return VDS link open file cache size in number of files.
6675 //     *
6676 //     * @exception HDF5LibraryException
6677 //     *                - Error from the HDF-5 Library.
6678 //     *
6679 //     **/
6680 //    public synchronized static native int H5Pget_vds_file_cache_size(long fapl_id) throws HDF5LibraryException;
6681 //
6682 //    /**
6683 //     * H5Pset_vds_file_cache_size sets the number of files that can be held open in an vds link open file cache.
6684 //     *
6685 //     * @param fapl_id
6686 //     *            IN: File access property list identifier
6687 //     * @param efc_size
6688 //     *            IN: VDS link open file cache size in number of files.
6689 //     *
6690 //     * @exception HDF5LibraryException
6691 //     *                - Error from the HDF-5 Library.
6692 //     *
6693 //     **/
6694 //    public synchronized static native void H5Pset_vds_file_cache_size(long fapl_id, int efc_size)
6695 //            throws HDF5LibraryException;
6696 
6697     /**
6698      * H5Pget_external returns information about an external file.
6699      *
6700      * @param plist
6701      *            IN: Identifier of a dataset creation property list.
6702      * @param idx
6703      *            IN: External file index.
6704      * @param name_size
6705      *            IN: Maximum length of name array.
6706      * @param name
6707      *            OUT: Name of the external file.
6708      * @param size
6709      *            OUT: the offset value and the size of the external file data.
6710      *
6711      *            <pre>
6712      *      size[0] = offset // a location to return an offset value
6713      *      size[1] = size // a location to return the size of
6714      *                // the external file data.
6715      * </pre>
6716      *
6717      * @return a non-negative value if successful
6718      *
6719      * @exception ArrayIndexOutOfBoundsException
6720      *                Fatal error on Copyback
6721      * @exception ArrayStoreException
6722      *                Fatal error on Copyback
6723      * @exception HDF5LibraryException
6724      *                - Error from the HDF-5 Library.
6725      * @exception NullPointerException
6726      *                - name or size is null.
6727      * @exception IllegalArgumentException
6728      *                - name_size &lt;= 0 .
6729      *
6730      **/
H5Pget_external(long plist, int idx, long name_size, String[] name, long[] size)6731     public synchronized static native int H5Pget_external(long plist, int idx, long name_size, String[] name,
6732             long[] size) throws ArrayIndexOutOfBoundsException, ArrayStoreException, HDF5LibraryException,
6733             NullPointerException, IllegalArgumentException;
6734 
6735     /**
6736      * H5Pset_external adds an external file to the list of external files.
6737      *
6738      * @param plist
6739      *            IN: Identifier of a dataset creation property list.
6740      * @param name
6741      *            IN: Name of an external file.
6742      * @param offset
6743      *            IN: Offset, in bytes, from the beginning of the file to the location in the file where the data
6744      *            starts.
6745      * @param size
6746      *            IN: Number of bytes reserved in the file for the data.
6747      *
6748      * @return a non-negative value if successful
6749      *
6750      * @exception HDF5LibraryException
6751      *                - Error from the HDF-5 Library.
6752      * @exception NullPointerException
6753      *                - name is null.
6754      **/
H5Pset_external(long plist, String name, long offset, long size)6755     public synchronized static native int H5Pset_external(long plist, String name, long offset, long size)
6756             throws HDF5LibraryException, NullPointerException;
6757 
6758     /**
6759      * H5Pget_external_count returns the number of external files for the specified dataset.
6760      *
6761      * @param plist
6762      *            IN: Identifier of a dataset creation property list.
6763      *
6764      * @return the number of external files if successful
6765      *
6766      * @exception HDF5LibraryException
6767      *                - Error from the HDF-5 Library.
6768      **/
H5Pget_external_count(long plist)6769     public synchronized static native int H5Pget_external_count(long plist) throws HDF5LibraryException;
6770 
H5Pset_szip(long plist, int options_mask, int pixels_per_block)6771     public synchronized static native int H5Pset_szip(long plist, int options_mask, int pixels_per_block)
6772             throws HDF5LibraryException, NullPointerException;
6773 
H5Pset_shuffle(long plist_id)6774     public synchronized static native int H5Pset_shuffle(long plist_id) throws HDF5LibraryException,
6775     NullPointerException;
6776 
6777     /**
6778      * H5Pset_nbit Sets up the use of the N-Bit filter.
6779      *
6780      * @param plist_id
6781      *            IN: Dataset creation property list identifier.
6782      *
6783      * @return a non-negative value if successful; otherwise returns a negative value.
6784      *
6785      * @exception HDF5LibraryException
6786      *                - Error from the HDF-5 Library.
6787      *
6788      **/
H5Pset_nbit(long plist_id)6789     public synchronized static native int H5Pset_nbit(long plist_id) throws HDF5LibraryException;
6790 
6791     /**
6792      * H5Pset_scaleoffset sets the Scale-Offset filter for a dataset.
6793      *
6794      * @param plist_id
6795      *            IN: Dataset creation property list identifier.
6796      * @param scale_type
6797      *            IN: Flag indicating compression method.
6798      * @param scale_factor
6799      *            IN: Parameter related to scale.
6800      *
6801      * @return a non-negative value if successful; otherwise returns a negative value.
6802      *
6803      * @exception HDF5LibraryException
6804      *                - Error from the HDF-5 Library.
6805      * @exception IllegalArgumentException
6806      *                - Invalid arguments
6807      *
6808      **/
H5Pset_scaleoffset(long plist_id, int scale_type, int scale_factor)6809     public synchronized static native int H5Pset_scaleoffset(long plist_id, int scale_type, int scale_factor)
6810             throws HDF5LibraryException, IllegalArgumentException;
6811 
6812     /**
6813      * H5Pget_fill_value queries the fill value property of a dataset creation property list.
6814      *
6815      * @param plist_id
6816      *            IN: Property list identifier.
6817      * @param type_id
6818      *            IN: The datatype identifier of value.
6819      * @param value
6820      *            IN: The fill value.
6821      *
6822      * @return a non-negative value if successful
6823      *
6824      * @exception HDF5Exception
6825      *                - Error converting data array.
6826      **/
H5Pget_fill_value(long plist_id, long type_id, byte[] value)6827     public synchronized static native int H5Pget_fill_value(long plist_id, long type_id, byte[] value)
6828             throws HDF5Exception;
6829 
6830     /**
6831      * H5Pget_fill_value queries the fill value property of a dataset creation property list.
6832      *
6833      * @param plist_id
6834      *            IN: Property list identifier.
6835      * @param type_id
6836      *            IN: The datatype identifier of value.
6837      * @param obj
6838      *            IN: The fill value.
6839      *
6840      * @return a non-negative value if successful
6841      *
6842      * @exception HDF5Exception
6843      *                - Error converting data array.
6844      **/
H5Pget_fill_value(long plist_id, long type_id, Object obj)6845     public synchronized static int H5Pget_fill_value(long plist_id, long type_id, Object obj) throws HDF5Exception {
6846         HDFArray theArray = new HDFArray(obj);
6847         byte[] buf = theArray.emptyBytes();
6848 
6849         int status = H5Pget_fill_value(plist_id, type_id, buf);
6850         if (status >= 0) {
6851             obj = theArray.arrayify(buf);
6852         }
6853 
6854         return status;
6855     }
6856 
6857     /**
6858      * H5Pset_fill_value sets the fill value for a dataset creation property list.
6859      *
6860      * @param plist_id
6861      *            IN: Property list identifier.
6862      * @param type_id
6863      *            IN: The datatype identifier of value.
6864      * @param value
6865      *            IN: The fill value.
6866      *
6867      * @return a non-negative value if successful
6868      *
6869      * @exception HDF5Exception
6870      *                - Error converting data array
6871      **/
H5Pset_fill_value(long plist_id, long type_id, byte[] value)6872     public synchronized static native int H5Pset_fill_value(long plist_id, long type_id, byte[] value)
6873             throws HDF5Exception;
6874 
6875     /**
6876      * H5Pset_fill_value sets the fill value for a dataset creation property list.
6877      *
6878      * @param plist_id
6879      *            IN: Property list identifier.
6880      * @param type_id
6881      *            IN: The datatype identifier of value.
6882      * @param obj
6883      *            IN: The fill value.
6884      *
6885      * @return a non-negative value if successful
6886      *
6887      * @exception HDF5Exception
6888      *                - Error converting data array
6889      **/
H5Pset_fill_value(long plist_id, long type_id, Object obj)6890     public synchronized static int H5Pset_fill_value(long plist_id, long type_id, Object obj) throws HDF5Exception {
6891         HDFArray theArray = new HDFArray(obj);
6892         byte[] buf = theArray.byteify();
6893 
6894         int retVal = H5Pset_fill_value(plist_id, type_id, buf);
6895 
6896         buf = null;
6897         theArray = null;
6898         return retVal;
6899     }
6900 
H5Pfill_value_defined(long plist_id, int[] status)6901     public synchronized static native int H5Pfill_value_defined(long plist_id, int[] status)
6902             throws HDF5LibraryException, NullPointerException;
6903 
H5Pget_alloc_time(long plist_id, int[] alloc_time)6904     public synchronized static native int H5Pget_alloc_time(long plist_id, int[] alloc_time)
6905             throws HDF5LibraryException, NullPointerException;
6906 
H5Pset_alloc_time(long plist_id, int alloc_time)6907     public synchronized static native int H5Pset_alloc_time(long plist_id, int alloc_time) throws HDF5LibraryException,
6908     NullPointerException;
6909 
H5Pget_fill_time(long plist_id, int[] fill_time)6910     public synchronized static native int H5Pget_fill_time(long plist_id, int[] fill_time) throws HDF5LibraryException,
6911     NullPointerException;
6912 
H5Pset_fill_time(long plist_id, int fill_time)6913     public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException,
6914     NullPointerException;
6915 
6916     /**
6917      * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list.
6918      *
6919      * @param dcpl_id
6920      *            IN: Dataset creation property list identifier
6921      * @param opts
6922      *            IN: Edge chunk option flag. Valid values are:
6923      *                H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS - filters are not applied to partial edge chunks.
6924      *                0 - Disables option; partial edge chunks will be compressed.
6925      *
6926      * @exception HDF5LibraryException
6927      *                - Error from the HDF-5 Library
6928      **/
H5Pset_chunk_opts(long dcpl_id, int opts)6929     public synchronized static native void H5Pset_chunk_opts(long dcpl_id, int opts) throws HDF5LibraryException;
6930 
6931     /**
6932      * H5Pget_chunk_opts retrieves the edge chunk option setting stored in the dataset creation property list .
6933      *
6934      * @param dcpl_id
6935      *            IN: Dataset creation property list
6936 
6937      * @return The edge chunk option setting.
6938      *
6939      * @exception HDF5LibraryException
6940      *                - Error from the HDF-5 Library
6941      **/
H5Pget_chunk_opts(long dcpl_id)6942     public synchronized static native int H5Pget_chunk_opts(long dcpl_id) throws HDF5LibraryException;
6943 
6944     /**
6945      * H5Pget_dset_no_attrs_hint accesses the flag for whether or not datasets created by the given dcpl
6946      *     will be created with a "minimized" object header.
6947      *
6948      * @param dcpl_id
6949      *            IN: Dataset creation property list
6950      *
6951      * @return true if the given dcpl is set to create minimized dataset object headers, false if not.
6952      *
6953      * @exception HDF5LibraryException
6954      *                - Error from the HDF-5 Library.
6955      **/
H5Pget_dset_no_attrs_hint(long dcpl_id)6956     public synchronized static native boolean H5Pget_dset_no_attrs_hint(long dcpl_id)
6957             throws HDF5LibraryException;
6958 
6959 
6960     /**
6961      * H5Pset_dset_no_attrs_hint sets the dcpl to minimize (or explicitly to not minimized) dataset object
6962      *     headers upon creation.
6963      *
6964      * @param dcpl_id
6965      *            IN: Dataset creation property list
6966      *
6967      * @param minimize
6968      *          the minimize hint setting
6969      *
6970      * @exception HDF5LibraryException
6971      *                - Error from the HDF-5 Library.
6972      **/
H5Pset_dset_no_attrs_hint(long dcpl_id, boolean minimize)6973     public synchronized static native void H5Pset_dset_no_attrs_hint(long dcpl_id, boolean minimize)
6974             throws HDF5LibraryException;
6975 
6976     // /////// Dataset access property list (DAPL) routines ///////
6977 
6978     /**
6979      * Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes
6980      * and the RDCC_W0 value in the raw data chunk cache on a per-datset basis.
6981      *
6982      * @param dapl_id
6983      *            IN: Identifier of the dataset access property list.
6984      * @param rdcc_nslots
6985      *            IN/OUT: Number of elements (objects) in the raw data chunk cache.
6986      * @param rdcc_nbytes
6987      *            IN/OUT: Total size of the raw data chunk cache, in bytes.
6988      * @param rdcc_w0
6989      *            IN/OUT: Preemption policy.
6990      *
6991      * @exception HDF5LibraryException
6992      *                - Error from the HDF-5 Library.
6993      * @exception NullPointerException
6994      *                - an array is null.
6995      **/
H5Pget_chunk_cache(long dapl_id, long[] rdcc_nslots, long[] rdcc_nbytes, double[] rdcc_w0)6996     public synchronized static native void H5Pget_chunk_cache(long dapl_id, long[] rdcc_nslots, long[] rdcc_nbytes,
6997             double[] rdcc_w0) throws HDF5LibraryException, NullPointerException;
6998 
6999     /**
7000      * H5Pset_chunk_cache sets the number of elements (objects) in the meta data cache and the total number of bytes in
7001      * the raw data chunk cache on a per-datset basis.
7002      *
7003      * @param dapl_id
7004      *            IN: Identifier of the datset access property list.
7005      * @param rdcc_nslots
7006      *            IN: Number of elements (objects) in the raw data chunk cache.
7007      * @param rdcc_nbytes
7008      *            IN: Total size of the raw data chunk cache, in bytes.
7009      * @param rdcc_w0
7010      *            IN: Preemption policy.
7011      *
7012      * @exception HDF5LibraryException
7013      *                - Error from the HDF-5 Library.
7014      **/
H5Pset_chunk_cache(long dapl_id, long rdcc_nslots, long rdcc_nbytes, double rdcc_w0)7015     public synchronized static native void H5Pset_chunk_cache(long dapl_id, long rdcc_nslots, long rdcc_nbytes,
7016             double rdcc_w0) throws HDF5LibraryException;
7017 
7018     /**
7019      * H5Pset_virtual_view takes the access property list for the virtual dataset, dapl_id, and the flag,
7020      * view, and sets the VDS view according to the flag value.
7021      *
7022      * @param dapl_id
7023      *            IN: Dataset access property list identifier for the virtual dataset
7024      * @param view
7025      *            IN: Flag specifying the extent of the data to be included in the view.
7026      *
7027      * @exception HDF5LibraryException
7028      *                - Error from the HDF-5 Library
7029      **/
H5Pset_virtual_view(long dapl_id, int view)7030     public synchronized static native void H5Pset_virtual_view(long dapl_id, int view) throws HDF5LibraryException;
7031 
7032     /**
7033      * H5Pget_virtual_view takes the virtual dataset access property list, dapl_id, and retrieves the flag,
7034      * view, set by the H5Pset_virtual_view call.
7035      *
7036      * @param dapl_id
7037      *            IN: Dataset access property list identifier for the virtual dataset
7038 
7039      * @return The flag specifying the view of the virtual dataset.
7040      *
7041      * @exception HDF5LibraryException
7042      *                - Error from the HDF-5 Library
7043      **/
H5Pget_virtual_view(long dapl_id)7044     public synchronized static native int H5Pget_virtual_view(long dapl_id) throws HDF5LibraryException;
7045 
7046     /**
7047      * H5Pset_virtual_printf_gap sets the access property list for the virtual dataset, dapl_id, to instruct the
7048      * library to stop looking for the mapped data stored in the files and/or datasets with the printf-style names
7049      * after not finding gap_size files and/or datasets. The found source files and datasets will determine the
7050      * extent of the unlimited virtual dataset with the printf-style mappings.
7051      *
7052      * @param dapl_id
7053      *            IN: Dataset access property list identifier for the virtual dataset
7054      * @param gap_size
7055      *            IN: Maximum number of files and/or datasets allowed to be missing for determining
7056      *            the extent of an unlimited virtual dataset with printf-style mappings.
7057      *
7058      * @exception HDF5LibraryException
7059      *                - Error from the HDF-5 Library
7060      **/
H5Pset_virtual_printf_gap(long dapl_id, long gap_size)7061     public synchronized static native void H5Pset_virtual_printf_gap(long dapl_id, long gap_size) throws HDF5LibraryException;
7062 
7063     /**
7064      * H5Pget_virtual_printf_gap returns the maximum number of missing printf-style files and/or datasets for
7065      * determining the extent of an unlimited virtual dataaset, gap_size, using the access property list for
7066      * the virtual dataset, dapl_id.
7067      *
7068      * @param dapl_id
7069      *            IN: Dataset access property list identifier for the virtual dataset
7070 
7071      * @return Maximum number of files and/or datasets allowed to be missing for determining
7072      *            the extent of an unlimited virtual dataset with printf-style mappings.
7073      *
7074      * @exception HDF5LibraryException
7075      *                - Error from the HDF-5 Library
7076      **/
H5Pget_virtual_printf_gap(long dapl_id)7077     public synchronized static native long H5Pget_virtual_printf_gap(long dapl_id) throws HDF5LibraryException;
7078 
7079     /**
7080      * H5Pget_virtual_prefix Retrieves prefix applied to virtual file paths.
7081      *
7082      * @param dapl_id
7083      *            IN: Link access property list identifier
7084      *
7085      * @return the prefix to be applied to virtual file paths.
7086      *
7087      * @exception HDF5LibraryException
7088      *                - Error from the HDF-5 Library.
7089      *
7090      **/
H5Pget_virtual_prefix(long dapl_id)7091     public synchronized static native String H5Pget_virtual_prefix(long dapl_id)
7092             throws HDF5LibraryException;
7093 
7094     /**
7095      * H5Pset_virtual_prefix Sets prefix to be applied to virtual file paths.
7096      *
7097      * @param dapl_id
7098      *            IN: Dataset access property list identifier
7099      * @param prefix
7100      *            IN: Prefix to be applied to virtual file paths
7101      *
7102      * @exception HDF5LibraryException
7103      *                - Error from the HDF-5 Library.
7104      * @exception NullPointerException
7105      *                - prefix is null.
7106      *
7107      **/
H5Pset_virtual_prefix(long dapl_id, String prefix)7108     public synchronized static native void H5Pset_virtual_prefix(long dapl_id, String prefix)
7109             throws HDF5LibraryException, NullPointerException;
7110 
7111     /**
7112      * H5Pget_efile_prefix Retrieves prefix applied to external file paths.
7113      *
7114      * @param dapl_id
7115      *            IN: Link access property list identifier
7116      *
7117      * @return the prefix to be applied to external file paths.
7118      *
7119      * @exception HDF5LibraryException
7120      *                - Error from the HDF-5 Library.
7121      *
7122      **/
H5Pget_efile_prefix(long dapl_id)7123     public synchronized static native String H5Pget_efile_prefix(long dapl_id)
7124             throws HDF5LibraryException;
7125 
7126     /**
7127      * H5Pset_efile_prefix Sets prefix to be applied to external file paths.
7128      *
7129      * @param dapl_id
7130      *            IN: Dataset access property list identifier
7131      * @param prefix
7132      *            IN: Prefix to be applied to external file paths
7133      *
7134      * @exception HDF5LibraryException
7135      *                - Error from the HDF-5 Library.
7136      * @exception NullPointerException
7137      *                - prefix is null.
7138      *
7139      **/
H5Pset_efile_prefix(long dapl_id, String prefix)7140     public synchronized static native void H5Pset_efile_prefix(long dapl_id, String prefix)
7141             throws HDF5LibraryException, NullPointerException;
7142 
7143     // public synchronized static native void H5Pset_append_flush(long plist_id, int ndims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException;
7144 
7145     // public synchronized static native void H5Pget_append_flush(long plist_id, int dims, long[] boundary, H5D_append_cb func, H5D_append_t udata) throws HDF5LibraryException;
7146 
7147 
7148     // /////// Dataset xfer property list (DXPL) routines ///////
7149 
7150     /**
7151      * H5Pget_data_transform retrieves the data transform expression previously set in the dataset transfer property
7152      * list plist_id by H5Pset_data_transform.
7153      *
7154      * @param plist_id
7155      *            IN: Identifier of the property list or class
7156      * @param size
7157      *            IN: Number of bytes of the transform expression to copy to
7158      * @param expression
7159      *            OUT: A data transform expression
7160      *
7161      * @return The size of the transform expression if successful; 0(zero) if no transform expression exists. Otherwise
7162      *         returns a negative value.
7163      *
7164      *
7165      * @exception HDF5LibraryException
7166      *                - Error from the HDF-5 Library.
7167      * @exception IllegalArgumentException
7168      *                - Size is &lt;= 0.
7169      *
7170      **/
H5Pget_data_transform(long plist_id, String[] expression, long size)7171     public synchronized static native long H5Pget_data_transform(long plist_id, String[] expression, long size)
7172             throws HDF5LibraryException, IllegalArgumentException;
7173 
7174     /**
7175      * H5Pset_data_transform sets a data transform expression
7176      *
7177      * @param plist_id
7178      *            IN: Identifier of the property list or class
7179      * @param expression
7180      *            IN: Pointer to the null-terminated data transform expression
7181      *
7182      * @return a non-negative valule if successful; otherwise returns a negative value.
7183      *
7184      * @exception HDF5LibraryException
7185      *                - Error from the HDF-5 Library.
7186      * @exception NullPointerException
7187      *                - expression is null.
7188      *
7189      **/
H5Pset_data_transform(long plist_id, String expression)7190     public synchronized static native int H5Pset_data_transform(long plist_id, String expression)
7191             throws HDF5LibraryException, NullPointerException;
7192 
7193     /**
7194      * HH5Pget_buffer gets type conversion and background buffers. Returns buffer size, in bytes, if successful;
7195      * otherwise 0 on failure.
7196      *
7197      * @param plist
7198      *            Identifier for the dataset transfer property list.
7199      * @param tconv
7200      *            byte array of application-allocated type conversion buffer.
7201      * @param bkg
7202      *            byte array of application-allocated background buffer.
7203      *
7204      * @return buffer size, in bytes, if successful; otherwise 0 on failure
7205      *
7206      * @exception HDF5LibraryException
7207      *                - Error from the HDF-5 Library.
7208      * @exception IllegalArgumentException
7209      *                - plist is invalid.
7210      **/
H5Pget_buffer(long plist, byte[] tconv, byte[] bkg)7211     public synchronized static native int H5Pget_buffer(long plist, byte[] tconv, byte[] bkg)
7212             throws HDF5LibraryException, IllegalArgumentException;
7213 
H5Pget_buffer_size(long plist)7214     public synchronized static native long H5Pget_buffer_size(long plist)
7215             throws HDF5LibraryException, IllegalArgumentException;
7216 
7217     /**
7218      * H5Pset_buffer sets type conversion and background buffers. status to TRUE or FALSE.
7219      *
7220      * Given a dataset transfer property list, H5Pset_buffer sets the maximum size for the type conversion buffer and
7221      * background buffer and optionally supplies pointers to application-allocated buffers. If the buffer size is
7222      * smaller than the entire amount of data being transferred between the application and the file, and a type
7223      * conversion buffer or background buffer is required, then strip mining will be used.
7224      *
7225      * Note that there are minimum size requirements for the buffer. Strip mining can only break the data up along the
7226      * first dimension, so the buffer must be large enough to accommodate a complete slice that encompasses all of the
7227      * remaining dimensions. For example, when strip mining a 100x200x300 hyperslab of a simple data space, the buffer
7228      * must be large enough to hold 1x200x300 data elements. When strip mining a 100x200x300x150 hyperslab of a simple
7229      * data space, the buffer must be large enough to hold 1x200x300x150 data elements.
7230      *
7231      * @param plist
7232      *            Identifier for the dataset transfer property list.
7233      * @param size
7234      *            Size, in bytes, of the type conversion and background buffers.
7235      *
7236      * @exception HDF5LibraryException
7237      *                - Error from the HDF-5 Library.
7238      * @exception IllegalArgumentException
7239      *                - plist is invalid.
7240      **/
H5Pset_buffer_size(long plist, long size)7241     public synchronized static native void H5Pset_buffer_size(long plist, long size) throws HDF5LibraryException,
7242     IllegalArgumentException;
7243 
H5Pget_edc_check(long plist)7244     public synchronized static native int H5Pget_edc_check(long plist) throws HDF5LibraryException,
7245     NullPointerException;
7246 
H5Pset_edc_check(long plist, int check)7247     public synchronized static native int H5Pset_edc_check(long plist, int check) throws HDF5LibraryException,
7248     NullPointerException;
7249 
7250     /**
7251      * H5Pget_btree_ratio Get the B-tree split ratios for a dataset transfer property list.
7252      *
7253      * @param plist_id
7254      *            IN Dataset transfer property list
7255      * @param left
7256      *            OUT split ratio for leftmost nodes
7257      * @param right
7258      *            OUT split ratio for righttmost nodes
7259      * @param middle
7260      *            OUT split ratio for all other nodes
7261      *
7262      * @return non-negative if succeed
7263      *
7264      * @exception HDF5LibraryException
7265      *                - Error from the HDF-5 Library.
7266      * @exception NullPointerException
7267      *                - an input array is null.
7268      **/
H5Pget_btree_ratios(long plist_id, double[] left, double[] middle, double[] right)7269     public synchronized static native int H5Pget_btree_ratios(long plist_id, double[] left, double[] middle,
7270             double[] right) throws HDF5LibraryException, NullPointerException;
7271 
7272     /**
7273      * H5Pset_btree_ratio Sets B-tree split ratios for a dataset transfer property list. The split ratios determine what
7274      * percent of children go in the first node when a node splits.
7275      *
7276      * @param plist_id
7277      *            IN Dataset transfer property list
7278      * @param left
7279      *            IN split ratio for leftmost nodes
7280      * @param right
7281      *            IN split ratio for righttmost nodes
7282      * @param middle
7283      *            IN split ratio for all other nodes
7284      *
7285      * @return non-negative if succeed
7286      *
7287      * @exception HDF5LibraryException
7288      *                - Error from the HDF-5 Library.
7289      **/
H5Pset_btree_ratios(long plist_id, double left, double middle, double right)7290     public synchronized static native int H5Pset_btree_ratios(long plist_id, double left, double middle, double right)
7291             throws HDF5LibraryException;
7292 
H5Pget_hyper_vector_size(long dxpl_id, long[] vector_size)7293     public synchronized static native int H5Pget_hyper_vector_size(long dxpl_id, long[] vector_size)
7294             throws HDF5LibraryException, NullPointerException;
7295 
H5Pset_hyper_vector_size(long dxpl_id, long vector_size)7296     public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size)
7297             throws HDF5LibraryException, NullPointerException;
7298 
7299     // /////// Link creation property list (LCPL) routines ///////
7300 
7301     /**
7302      * H5Pget_create_intermediate_group determines whether property is set to enable creating missing intermediate
7303      * groups.
7304      *
7305      * @param lcpl_id
7306      *            IN: Link creation property list identifier
7307      *
7308      * @return Boolean true or false
7309      *
7310      * @exception HDF5LibraryException
7311      *                - Error from the HDF-5 Library.
7312      *
7313      **/
H5Pget_create_intermediate_group(long lcpl_id)7314     public synchronized static native boolean H5Pget_create_intermediate_group(long lcpl_id)
7315             throws HDF5LibraryException;
7316 
7317     /**
7318      * H5Pset_create_intermediate_group specifies in property list whether to create missing intermediate groups
7319      *
7320      * @param lcpl_id
7321      *            IN: Link creation property list identifier
7322      * @param crt_intermed_group
7323      *            IN: Flag specifying whether to create intermediate groups upon the creation of an object
7324      *
7325      * @return a non-negative valule if successful; otherwise returns a negative value.
7326      *
7327      * @exception HDF5LibraryException
7328      *                - Error from the HDF-5 Library.
7329      *
7330      **/
H5Pset_create_intermediate_group(long lcpl_id, boolean crt_intermed_group)7331     public synchronized static native int H5Pset_create_intermediate_group(long lcpl_id, boolean crt_intermed_group)
7332             throws HDF5LibraryException;
7333 
7334     // /////// Group creation property list (GCPL) routines ///////
7335 
7336     /**
7337      * H5Pget_local_heap_size_hint Retrieves the anticipated size of the local heap for original-style groups.
7338      *
7339      * @param gcpl_id
7340      *            IN: Group creation property list identifier
7341      *
7342      * @return size_hint, the anticipated size of local heap
7343      *
7344      * @exception HDF5LibraryException
7345      *                - Error from the HDF-5 Library.
7346      *
7347      **/
H5Pget_local_heap_size_hint(long gcpl_id)7348     public synchronized static native long H5Pget_local_heap_size_hint(long gcpl_id) throws HDF5LibraryException;
7349 
7350     /**
7351      * H5Pset_local_heap_size_hint Specifies the anticipated maximum size of a local heap.
7352      *
7353      * @param gcpl_id
7354      *            IN: Group creation property list identifier
7355      * @param size_hint
7356      *            IN: Anticipated maximum size in bytes of local heap
7357      *
7358      * @return a non-negative value if successful; otherwise returns a negative value.
7359      *
7360      * @exception HDF5LibraryException
7361      *                - Error from the HDF-5 Library.
7362      *
7363      **/
H5Pset_local_heap_size_hint(long gcpl_id, long size_hint)7364     public synchronized static native int H5Pset_local_heap_size_hint(long gcpl_id, long size_hint)
7365             throws HDF5LibraryException;
7366 
7367     /**
7368      * H5Pget_link_phase_change Queries the settings for conversion between compact and dense groups.
7369      *
7370      * @param gcpl_id
7371      *            IN: Group creation property list identifier
7372      * @param links
7373      *            The max. no. of compact links &amp; the min. no. of dense links, which are used for storing groups
7374      *
7375      *            <pre>
7376      *      links[0] =  The maximum number of links for compact storage
7377      *      links[1] =  The minimum number of links for dense storage
7378      * </pre>
7379      *
7380      * @return Returns a non-negative value if successful; otherwise returns a negative value.
7381      *
7382      * @exception HDF5LibraryException
7383      *                - Error from the HDF-5 Library.
7384      * @exception NullPointerException
7385      *                - size is null.
7386      *
7387      **/
H5Pget_link_phase_change(long gcpl_id, int[] links)7388     public synchronized static native int H5Pget_link_phase_change(long gcpl_id, int[] links)
7389             throws HDF5LibraryException, NullPointerException;
7390 
7391     /**
7392      * H5Pset_link_phase_change Sets the parameters for conversion between compact and dense groups.
7393      *
7394      * @param gcpl_id
7395      *            IN: Group creation property list identifier
7396      * @param max_compact
7397      *            IN: Maximum number of links for compact storage(Default: 8)
7398      * @param min_dense
7399      *            IN: Minimum number of links for dense storage(Default: 6)
7400      *
7401      * @return a non-negative value if successful; otherwise returns a negative value.
7402      *
7403      * @exception HDF5LibraryException
7404      *                - Error from the HDF-5 Library.
7405      * @exception IllegalArgumentException
7406      *                - Invalid values of max_compact and min_dense.
7407      *
7408      **/
H5Pset_link_phase_change(long gcpl_id, int max_compact, int min_dense)7409     public synchronized static native int H5Pset_link_phase_change(long gcpl_id, int max_compact, int min_dense)
7410             throws HDF5LibraryException, IllegalArgumentException;
7411 
7412     /**
7413      * H5Pget_est_link_info Queries data required to estimate required local heap or object header size.
7414      *
7415      * @param gcpl_id
7416      *            IN: Group creation property list identifier
7417      * @param link_info
7418      *            Estimated number of links to be inserted into group And the estimated average length of link names
7419      *
7420      *            <pre>
7421      *      link_info[0] =  Estimated number of links to be inserted into group
7422      *      link_info[1] =  Estimated average length of link names
7423      * </pre>
7424      *
7425      * @return Returns a non-negative value if successful; otherwise returns a negative value.
7426      *
7427      * @exception HDF5LibraryException
7428      *                - Error from the HDF-5 Library.
7429      * @exception NullPointerException
7430      *                - link_info is null.
7431      *
7432      **/
H5Pget_est_link_info(long gcpl_id, int[] link_info)7433     public synchronized static native int H5Pget_est_link_info(long gcpl_id, int[] link_info)
7434             throws HDF5LibraryException, NullPointerException;
7435 
7436     /**
7437      * H5Pset_est_link_info Sets estimated number of links and length of link names in a group.
7438      *
7439      * @param gcpl_id
7440      *            IN: Group creation property list identifier
7441      * @param est_num_entries
7442      *            IN: Estimated number of links to be inserted into group
7443      * @param est_name_len
7444      *            IN: Estimated average length of link names
7445      *
7446      * @return a non-negative value if successful; otherwise returns a negative value.
7447      *
7448      * @exception HDF5LibraryException
7449      *                - Error from the HDF-5 Library.
7450      * @exception IllegalArgumentException
7451      *                - Invalid values to est_num_entries and est_name_len.
7452      *
7453      **/
H5Pset_est_link_info(long gcpl_id, int est_num_entries, int est_name_len)7454     public synchronized static native int H5Pset_est_link_info(long gcpl_id, int est_num_entries, int est_name_len)
7455             throws HDF5LibraryException, IllegalArgumentException;
7456 
7457     /**
7458      * H5Pget_link_creation_order queries the group creation property list, gcpl_id, and returns a flag indicating
7459      * whether link creation order is tracked and/or indexed in a group.
7460      *
7461      * @param gcpl_id
7462      *            IN: Group creation property list identifier
7463      *
7464      * @return crt_order_flags -Creation order flag(s)
7465      *
7466      * @exception HDF5LibraryException
7467      *                - Error from the HDF-5 Library.
7468      *
7469      **/
H5Pget_link_creation_order(long gcpl_id)7470     public synchronized static native int H5Pget_link_creation_order(long gcpl_id) throws HDF5LibraryException;
7471 
7472     /**
7473      * H5Pset_link_creation_order Sets flags in a group creation property list, gcpl_id, for tracking and/or indexing
7474      * links on creation order.
7475      *
7476      * @param gcpl_id
7477      *            IN: Group creation property list identifier
7478      * @param crt_order_flags
7479      *            IN: Creation order flag(s)
7480      *
7481      *
7482      * @return Returns a non-negative value if successful; otherwise returns a negative value.
7483      *
7484      * @exception HDF5LibraryException
7485      *                - Error from the HDF-5 Library.
7486      *
7487      **/
H5Pset_link_creation_order(long gcpl_id, int crt_order_flags)7488     public synchronized static native int H5Pset_link_creation_order(long gcpl_id, int crt_order_flags)
7489             throws HDF5LibraryException;
7490 
7491     // /////// String creation property list (STRCPL) routines ///////
7492 
H5Pget_char_encoding(long plist_id)7493     public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException;
7494 
H5Pset_char_encoding(long plist_id, int encoding)7495     public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding)
7496             throws HDF5LibraryException;
7497 
7498     // /////// Link access property list (LAPL) routines ///////
7499 
7500     /**
7501      * H5Pget_nlinks retrieves the maximum number of soft or user-defined link traversals allowed, nlinks, before the
7502      * library assumes it has found a cycle and aborts the traversal. This value is retrieved from the link access
7503      * property list lapl_id.
7504      *
7505      * @param lapl_id
7506      *            IN: File access property list identifier
7507      *
7508      * @return Returns a Maximum number of links to traverse.
7509      *
7510      * @exception HDF5LibraryException
7511      *                - Error from the HDF-5 Library.
7512      *
7513      **/
H5Pget_nlinks(long lapl_id)7514     public synchronized static native long H5Pget_nlinks(long lapl_id) throws HDF5LibraryException;
7515 
7516     /**
7517      * H5Pset_nlinks sets the maximum number of soft or user-defined link traversals allowed, nlinks, before the library
7518      * assumes it has found a cycle and aborts the traversal. This value is set in the link access property list
7519      * lapl_id.
7520      *
7521      * @param lapl_id
7522      *            IN: File access property list identifier
7523      * @param nlinks
7524      *            IN: Maximum number of links to traverse
7525      *
7526      * @return Returns a non-negative value if successful; otherwise returns a negative value.
7527      *
7528      * @exception HDF5LibraryException
7529      *                - Error from the HDF-5 Library.
7530      * @exception IllegalArgumentException
7531      *                - Argument is Illegal
7532      *
7533      **/
H5Pset_nlinks(long lapl_id, long nlinks)7534     public synchronized static native int H5Pset_nlinks(long lapl_id, long nlinks) throws HDF5LibraryException,
7535     IllegalArgumentException;
7536 
7537     /**
7538      * H5Pget_elink_prefix Retrieves prefix applied to external link paths.
7539      *
7540      * @param lapl_id
7541      *            IN: Link access property list identifier
7542      * @param prefix
7543      *            OUT: Prefix applied to external link paths
7544      *
7545      * @return If successful, returns a non-negative value specifying the size in bytes of the prefix without the NULL
7546      *         terminator; otherwise returns a negative value.
7547      *
7548      * @exception HDF5LibraryException
7549      *                - Error from the HDF-5 Library.
7550      * @exception NullPointerException
7551      *                - prefix is null.
7552      *
7553      **/
H5Pget_elink_prefix(long lapl_id, String[] prefix)7554     public synchronized static native long H5Pget_elink_prefix(long lapl_id, String[] prefix)
7555             throws HDF5LibraryException, NullPointerException;
7556 
7557     /**
7558      * H5Pset_elink_prefix Sets prefix to be applied to external link paths.
7559      *
7560      * @param lapl_id
7561      *            IN: Link access property list identifier
7562      * @param prefix
7563      *            IN: Prefix to be applied to external link paths
7564      *
7565      * @return a non-negative value if successful; otherwise returns a negative value.
7566      *
7567      * @exception HDF5LibraryException
7568      *                - Error from the HDF-5 Library.
7569      * @exception NullPointerException
7570      *                - prefix is null.
7571      *
7572      **/
H5Pset_elink_prefix(long lapl_id, String prefix)7573     public synchronized static native int H5Pset_elink_prefix(long lapl_id, String prefix) throws HDF5LibraryException,
7574     NullPointerException;
7575 
7576     /**
7577      * H5Pget_elink_fapl Retrieves the file access property list identifier associated with the link access property
7578      * list.
7579      *
7580      * @param lapl_id
7581      *            IN: Link access property list identifier
7582      *
7583      * @return a non-negative value if successful; otherwise returns a negative value.
7584      *
7585      * @exception HDF5LibraryException
7586      *                - Error from the HDF-5 Library.
7587      *
7588      **/
H5Pget_elink_fapl(long lapl_id)7589     public static long H5Pget_elink_fapl(long lapl_id) throws HDF5LibraryException {
7590         long id = _H5Pget_elink_fapl(lapl_id);
7591         if (id > 0) {
7592             log.trace("OPEN_IDS: H5Pget_elink_fapl add {}", id);
7593             OPEN_IDS.add(id);
7594             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
7595         }
7596         return id;
7597     }
7598 
_H5Pget_elink_fapl(long lapl_id)7599     private synchronized static native long _H5Pget_elink_fapl(long lapl_id) throws HDF5LibraryException;
7600 
7601     /**
7602      * H5Pset_elink_fapl sets a file access property list for use in accessing a file pointed to by an external link.
7603      *
7604      * @param lapl_id
7605      *            IN: Link access property list identifier
7606      * @param fapl_id
7607      *            IN: File access property list identifier
7608      *
7609      * @return a non-negative value if successful; otherwise returns a negative value.
7610      *
7611      * @exception HDF5LibraryException
7612      *                - Error from the HDF-5 Library.
7613      *
7614      **/
H5Pset_elink_fapl(long lapl_id, long fapl_id)7615     public synchronized static native int H5Pset_elink_fapl(long lapl_id, long fapl_id) throws HDF5LibraryException;
7616 
7617     /**
7618      * H5Pget_elink_acc_flags retrieves the external link traversal file access flag from the specified link access
7619      * property list.
7620      *
7621      * @param lapl_id
7622      *            IN: Link access property list identifier
7623      *
7624      * @return File access flag for link traversal.
7625      *
7626      * @exception HDF5LibraryException
7627      *                - Error from the HDF-5 Library.
7628      *
7629      **/
H5Pget_elink_acc_flags(long lapl_id)7630     public synchronized static native int H5Pget_elink_acc_flags(long lapl_id) throws HDF5LibraryException;
7631 
7632     /**
7633      * H5Pset_elink_acc_flags Sets the external link traversal file access flag in a link access property list.
7634      *
7635      * @param lapl_id
7636      *            IN: Link access property list identifier
7637      * @param flags
7638      *            IN: The access flag for external link traversal.
7639      *
7640      * @return a non-negative value if successful; otherwise returns a negative value.
7641      *
7642      * @exception HDF5LibraryException
7643      *                - Error from the HDF-5 Library.
7644      * @exception IllegalArgumentException
7645      *                - Invalid Flag values.
7646      *
7647      **/
H5Pset_elink_acc_flags(long lapl_id, int flags)7648     public synchronized static native int H5Pset_elink_acc_flags(long lapl_id, int flags) throws HDF5LibraryException,
7649     IllegalArgumentException;
7650 
7651     // /////// Object copy property list (OCPYPL) routines ///////
7652 
7653     /**
7654      * H5Pget_copy_object retrieves the properties to be used when an object is copied.
7655      *
7656      * @param ocp_plist_id
7657      *            IN: Object copy property list identifier
7658      *
7659      * @return Copy option(s) set in the object copy property list
7660      *
7661      * @exception HDF5LibraryException
7662      *                - Error from the HDF-5 Library.
7663      *
7664      **/
H5Pget_copy_object(long ocp_plist_id)7665     public synchronized static native int H5Pget_copy_object(long ocp_plist_id) throws HDF5LibraryException;
7666 
7667     /**
7668      * H5Pset_copy_object Sets properties to be used when an object is copied.
7669      *
7670      * @param ocp_plist_id
7671      *            IN: Object copy property list identifier
7672      * @param copy_options
7673      *            IN: Copy option(s) to be set
7674      *
7675      * @exception HDF5LibraryException
7676      *                - Error from the HDF-5 Library.
7677      *
7678      **/
H5Pset_copy_object(long ocp_plist_id, int copy_options)7679     public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options)
7680             throws HDF5LibraryException;
7681 
7682     // /////// Other/Older property list routines ///////
7683 
7684     /**
7685      * H5Pget_version retrieves the version information of various objects for a file creation property list.
7686      *
7687      * @param plist
7688      *            IN: Identifier of the file creation property list.
7689      * @param version_info
7690      *            OUT: version information.
7691      *
7692      *            <pre>
7693      *      version_info[0] = boot  // boot block version number
7694      *      version_info[1] = freelist  // global freelist version
7695      *      version_info[2] = stab  // symbol tabl version number
7696      *      version_info[3] = shhdr  // shared object header version
7697      * </pre>
7698      * @return a non-negative value, with the values of version_info initialized, if successful
7699      *
7700      * @exception HDF5LibraryException
7701      *                - Error from the HDF-5 Library.
7702      * @exception NullPointerException
7703      *                - version_info is null.
7704      * @exception IllegalArgumentException
7705      *                - version_info is illegal.
7706      *
7707      * @deprecated As of HDF5 1.10.0 in favor of H5Fget_info.
7708      **/
H5Pget_version(long plist, int[] version_info)7709     public synchronized static native int H5Pget_version(long plist, int[] version_info) throws HDF5LibraryException,
7710     NullPointerException, IllegalArgumentException;
7711 
7712     // /////// file drivers property list routines ///////
7713 
H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store)7714     public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store)
7715             throws HDF5LibraryException, NullPointerException;
7716 
H5Pset_fapl_core(long fapl_id, long increment, boolean backing_store)7717     public synchronized static native int H5Pset_fapl_core(long fapl_id, long increment, boolean backing_store)
7718             throws HDF5LibraryException, NullPointerException;
7719 
7720     /**
7721      * H5Pget_fapl_direct Retrieve direct I/O settings.
7722      *
7723      * @param fapl_id
7724      *            IN: File access property list identifier
7725      * @param info
7726      *            OUT: Returned property list information info[0] = alignment Required memory alignment boundary info[1]
7727      *            = block_size File system block size info[2] = cbuf_size Copy buffer size
7728      *
7729      * @return a non-negative value if successful; otherwise returns a negative value.
7730      *
7731      * @exception HDF5LibraryException
7732      *                - Error from the HDF-5 Library.
7733      *
7734      **/
H5Pget_fapl_direct(long fapl_id, long[] info)7735     public synchronized static native int H5Pget_fapl_direct(long fapl_id, long[] info) throws HDF5LibraryException;
7736 
7737     /**
7738      * H5Pset_fapl_direct Sets up use of the direct I/O driver.
7739      *
7740      * @param fapl_id
7741      *            IN: File access property list identifier
7742      * @param alignment
7743      *            IN: Required memory alignment boundary
7744      * @param block_size
7745      *            IN: File system block size
7746      * @param cbuf_size
7747      *            IN: Copy buffer size
7748      *
7749      * @return a non-negative value if successful; otherwise returns a negative value.
7750      *
7751      * @exception HDF5LibraryException
7752      *                - Error from the HDF-5 Library.
7753      *
7754      **/
H5Pset_fapl_direct(long fapl_id, long alignment, long block_size, long cbuf_size)7755     public synchronized static native int H5Pset_fapl_direct(long fapl_id, long alignment, long block_size,
7756             long cbuf_size) throws HDF5LibraryException;
7757 
H5Pget_fapl_family(long fapl_id, long[] memb_size, long[] memb_fapl_id)7758     public synchronized static native int H5Pget_fapl_family(long fapl_id, long[] memb_size, long[] memb_fapl_id)
7759             throws HDF5LibraryException, NullPointerException;
7760 
H5Pset_fapl_family(long fapl_id, long memb_size, long memb_fapl_id)7761     public synchronized static native int H5Pset_fapl_family(long fapl_id, long memb_size, long memb_fapl_id)
7762             throws HDF5LibraryException, NullPointerException;
7763 
H5Pset_fapl_hdfs(long fapl_id, H5FD_hdfs_fapl_t fapl_conf)7764     public synchronized static native int H5Pset_fapl_hdfs(long fapl_id, H5FD_hdfs_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException;
7765 
H5Pget_fapl_hdfs(long fapl_id)7766     public synchronized static native H5FD_hdfs_fapl_t H5Pget_fapl_hdfs(long fapl_id) throws HDF5LibraryException, NullPointerException;
7767 
7768     /**
7769      * H5Pget_fapl_multi Sets up use of the multi I/O driver.
7770      *
7771      * @param fapl_id
7772      *            IN: File access property list identifier
7773      * @param memb_map
7774      *            IN: Maps memory usage types to other memory usage types.
7775      * @param memb_fapl
7776      *            IN: Property list for each memory usage type.
7777      * @param memb_name
7778      *            IN: Name generator for names of member files.
7779      * @param memb_addr
7780      *            IN: The offsets within the virtual address space, from 0 (zero) to HADDR_MAX, at which each type of
7781      *            data storage begins.
7782      *
7783      * @return a boolean value; Allows read-only access to incomplete file sets when TRUE.
7784      *
7785      * @exception HDF5LibraryException
7786      *                - Error from the HDF-5 Library.
7787      * @exception NullPointerException
7788      *                - an array is null.
7789      *
7790      **/
H5Pget_fapl_multi(long fapl_id, int[] memb_map, long[] memb_fapl, String[] memb_name, long[] memb_addr)7791     public synchronized static native boolean H5Pget_fapl_multi(long fapl_id, int[] memb_map, long[] memb_fapl,
7792             String[] memb_name, long[] memb_addr) throws HDF5LibraryException, NullPointerException;
7793 
7794     /**
7795      * H5Pset_fapl_multi Sets up use of the multi I/O driver.
7796      *
7797      * @param fapl_id
7798      *            IN: File access property list identifier
7799      * @param memb_map
7800      *            IN: Maps memory usage types to other memory usage types.
7801      * @param memb_fapl
7802      *            IN: Property list for each memory usage type.
7803      * @param memb_name
7804      *            IN: Name generator for names of member files.
7805      * @param memb_addr
7806      *            IN: The offsets within the virtual address space, from 0 (zero) to HADDR_MAX, at which each type of
7807      *            data storage begins.
7808      * @param relax
7809      *            IN: Allows read-only access to incomplete file sets when TRUE.
7810      *
7811      * @exception HDF5LibraryException
7812      *                - Error from the HDF-5 Library.
7813      * @exception NullPointerException
7814      *                - an array is null.
7815      *
7816      **/
H5Pset_fapl_multi(long fapl_id, int[] memb_map, long[] memb_fapl, String[] memb_name, long[] memb_addr, boolean relax)7817     public synchronized static native void H5Pset_fapl_multi(long fapl_id, int[] memb_map, long[] memb_fapl,
7818             String[] memb_name, long[] memb_addr, boolean relax) throws HDF5LibraryException, NullPointerException;
7819 
7820 
7821     /**
7822      * H5Pset_fapl_log Sets up the logging virtual file driver (H5FD_LOG) for use. H5Pset_fapl_log modifies the file
7823      * access property list to use the logging driver, H5FD_LOG. The logging virtual file driver (VFD) is a clone of the
7824      * standard SEC2 (H5FD_SEC2) driver with additional facilities for logging VFD metrics and activity to a file.
7825      *
7826      * @param fapl_id
7827      *            IN: File access property list identifier.
7828      * @param logfile
7829      *            IN: logfile is the name of the file in which the logging entries are to be recorded.
7830      * @param flags
7831      *            IN: Flags specifying the types of logging activity.
7832      * @param buf_size
7833      *            IN: The size of the logging buffers, in bytes.
7834      *
7835      * @exception HDF5LibraryException
7836      *                - Error from the HDF-5 Library.
7837      * @exception NullPointerException
7838      *                - logfile is null.
7839      **/
H5Pset_fapl_log(long fapl_id, String logfile, long flags, long buf_size)7840     public synchronized static native void H5Pset_fapl_log(long fapl_id, String logfile, long flags, long buf_size)
7841             throws HDF5LibraryException, NullPointerException;
7842 
H5Pset_fapl_sec2(long fapl_id)7843     public synchronized static native int H5Pset_fapl_sec2(long fapl_id) throws HDF5LibraryException, NullPointerException;
7844 
H5Pset_fapl_split(long fapl_id, String meta_ext, long meta_plist_id, String raw_ext, long raw_plist_id)7845     public synchronized static native void H5Pset_fapl_split(long fapl_id, String meta_ext, long meta_plist_id,
7846             String raw_ext, long raw_plist_id) throws HDF5LibraryException, NullPointerException;
7847 
H5Pset_fapl_stdio(long fapl_id)7848     public synchronized static native int H5Pset_fapl_stdio(long fapl_id) throws HDF5LibraryException, NullPointerException;
7849 
H5Pset_fapl_windows(long fapl_id)7850     public synchronized static native int H5Pset_fapl_windows(long fapl_id) throws HDF5LibraryException, NullPointerException;
7851 
H5Pset_fapl_ros3(long fapl_id, H5FD_ros3_fapl_t fapl_conf)7852     public synchronized static native int H5Pset_fapl_ros3(long fapl_id, H5FD_ros3_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException;
7853 
H5Pget_fapl_ros3(long fapl_id)7854     public synchronized static native H5FD_ros3_fapl_t H5Pget_fapl_ros3(long fapl_id) throws HDF5LibraryException, NullPointerException;
7855 
7856     // /////// unimplemented ////////
7857 
7858     // Generic property list routines //
7859     // herr_t H5Pencode(hid_t plist_id, void *buf, size_t *nalloc);
7860     // hid_t  H5Pdecode(const void *buf);
7861 
7862     // Object creation property list (OCPL) routines //
7863 
7864     // File creation property list (FCPL) routines //
7865 
7866     // File access property list (FAPL) routines //
7867     // herr_t H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info)
7868     // const void *H5Pget_driver_info(hid_t plist_id)
7869     // herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type)
7870     // herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type)
7871     // herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr);
7872     // herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len);
7873     // herr_t H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr);
7874     // herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr);
7875     // herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size);
7876     // herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size);
7877     // #ifdef H5_HAVE_PARALLEL
7878     // herr_t H5Pset_all_coll_metadata_ops(hid_t accpl_id, hbool_t is_collective);
7879     //  herr_t H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective);
7880     // herr_t H5Pset_coll_metadata_write(hid_t fapl_id, hbool_t is_collective);
7881     // herr_t H5Pget_coll_metadata_write(hid_t fapl_id, hbool_t *is_collective);
7882     // #endif /* H5_HAVE_PARALLEL */
7883     //  herr_t H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr);
7884     //  herr_t H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr /*out*/);
7885     //  herr_t H5Pset_page_buffer_size(hid_t plist_id, size_t buf_size, unsigned min_meta_per, unsigned min_raw_per);
7886     // herr_t H5Pget_page_buffer_size(hid_t fapl_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc);
7887     // herr_t H5Pset_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t func, void *user_data);
7888     // herr_t H5Pget_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t *func, void **user_data);
7889 
7890     // Dataset creation property list (DCPL) routines //
7891 
7892     // Dataset access property list (DAPL) routines //
7893     // herr_t H5Pset_append_flush (hid_t dapl_id, int ndims, const hsize_t boundary[], H5D_append_cb_t func, void *user_data);
7894     // herr_t H5Pget_append_flush(hid_t dapl_id, int ndims, hsize_t boundary[], H5D_append_cb_t *func, void **user_data)
7895 
7896     // Dataset xfer property list (DXPL) routines //
7897     // herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg);
7898     // herr_t H5Pset_preserve(hid_t plist_id, hbool_t status);
7899     // int H5Pget_preserve(hid_t plist_id);
7900     // herr_t H5Pset_filter_callback(hid_t plist, H5Z_filter_func_t func, void *op_data)
7901     // herr_t H5Pget_vlen_mem_manager(hid_t plist, H5MM_allocate_t *alloc, void **alloc_info, H5MM_free_t *free, void
7902     // **free_info )
7903     // herr_t H5Pset_vlen_mem_manager(hid_t plist, H5MM_allocate_t alloc, void *alloc_info, H5MM_free_t free, void
7904     // *free_info )
7905     // herr_t H5Pget_type_conv_cb(hid_t plist, H5T_conv_except_func_t *func, void **op_data)
7906     // herr_t H5Pset_type_conv_cb( hid_t plist, H5T_conv_except_func_t func, void *op_data)
7907     // #ifdef H5_HAVE_PARALLEL
7908     //  herr_t H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode);
7909     //  herr_t H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode);
7910     //  herr_t H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause, uint32_t *global_no_collective_cause);
7911     // #endif /* H5_HAVE_PARALLEL */
7912 
7913     // Link creation property list (LCPL) routines //
7914 
7915     // Group creation property list (GCPL) routines //
7916 
7917     // String creation property list (STRCPL) routines //
7918 
7919     // Link access property list (LAPL) routines //
7920     // herr_t H5Pget_elink_cb( hid_t lapl_id, H5L_elink_traverse_t *func, void **op_data )
7921     // herr_t H5Pset_elink_cb( hid_t lapl_id, H5L_elink_traverse_t func, void *op_data )
7922 
7923     // Object copy property list (OCPYPL) routines //
7924     // herr_t H5Padd_merge_committed_dtype_path(hid_t plist_id, const char *path);
7925     // herr_t H5Pfree_merge_committed_dtype_paths(hid_t plist_id);
7926     // herr_t H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data);
7927     // herr_t H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, void *op_data);
7928 
7929     // ////////////////////////////////////////////////////////////
7930     // //
7931     // H5PL: HDF5 1.8 Plugin API Functions //
7932     // //
7933     // ////////////////////////////////////////////////////////////
7934     /**
7935      * H5PLset_loading_state uses one argument to enable or disable individual plugins.
7936      *        The plugin_flags parameter is an encoded integer in which each bit controls a specific
7937      *        plugin or class of plugins.
7938      *        A plugin bit set to 0 (zero) prevents the use of the dynamic plugin corresponding
7939      *        to that bit position. A plugin bit set to 1 (one) allows the use of that dynamic plugin.
7940      *        All dynamic plugins can be enabled by setting plugin_flags to a negative value.
7941      *        A value of 0 (zero) will disable all dynamic plugins.
7942      *
7943      *        H5PLset_loading_state inspects the HDF5_PLUGIN_PRELOAD environment variable every
7944      *        time it is called. If the environment variable is set to the special :: string,
7945      *        all dynamic plugins will be disabled.
7946      *
7947      * @param plugin_flags
7948      *            IN: The list of dynamic plugin types to enable or disable.
7949      *                A plugin bit set to 0 (zero) prevents use of that dynamic plugin.
7950      *                A plugin bit set to 1 (one) enables use of that dynamic plugin.
7951      *                Setting plugin_flags to a negative value enables all dynamic plugins.
7952      *                Setting plugin_flags to 0 (zero) disables all dynamic plugins.
7953      *
7954      *
7955      * @exception HDF5LibraryException
7956      *                - Error from the HDF-5 Library.
7957      **/
H5PLset_loading_state(int plugin_flags)7958     public synchronized static native void H5PLset_loading_state(int plugin_flags) throws HDF5LibraryException;
7959 
7960     /**
7961      * H5PLget_loading_state retrieves the state of the dynamic plugins flag, plugin_flags..
7962      *
7963      * @return the list of dynamic plugin types that are enabled or disabled.
7964      *             A plugin bit set to 0 (zero) indicates that that dynamic plugin is disabled.
7965      *             A plugin bit set to 1 (one) indicates that that dynamic plugin is enabled.
7966      *             If the value of plugin_flags is negative, all dynamic plugins are enabled.
7967      *             If the value of plugin_flags is 0 (zero), all dynamic plugins are disabled.
7968      *
7969      * @exception HDF5LibraryException
7970      *                - Error from the HDF-5 Library.
7971      **/
H5PLget_loading_state()7972     public synchronized static native int H5PLget_loading_state() throws HDF5LibraryException;
7973 
7974     /**
7975      * H5PLappend inserts the plugin path at the end of the table.
7976      *
7977      * @param plugin_path
7978      *            IN: Path for location of filter plugin libraries.
7979      *
7980      * @exception HDF5LibraryException
7981      *                - Error from the HDF-5 Library.
7982      **/
H5PLappend(String plugin_path)7983     public synchronized static native void H5PLappend(String plugin_path) throws HDF5LibraryException;
7984 
7985     /**
7986      * H5PLprepend inserts the plugin path at the beginning of the table.
7987      *
7988      * @param plugin_path
7989      *            IN: Path for location of filter plugin libraries.
7990      *
7991      * @exception HDF5LibraryException
7992      *                - Error from the HDF-5 Library.
7993      **/
H5PLprepend(String plugin_path)7994     public synchronized static native void H5PLprepend(String plugin_path) throws HDF5LibraryException;
7995 
7996     /**
7997      * H5PLreplace replaces the plugin path at the specified index.
7998      *
7999      * @param plugin_path
8000      *            IN: Path for location of filter plugin libraries.
8001      * @param index
8002      *            IN: The table index (0-based).
8003      *
8004      * @exception HDF5LibraryException
8005      *                - Error from the HDF-5 Library.
8006      **/
H5PLreplace(String plugin_path, int index)8007     public synchronized static native void H5PLreplace(String plugin_path, int index) throws HDF5LibraryException;
8008 
8009     /**
8010      * H5PLinsert inserts the plugin path at the specified index.
8011      *
8012      * @param plugin_path
8013      *            IN: Path for location of filter plugin libraries.
8014      * @param index
8015      *            IN: The table index (0-based).
8016      *
8017      * @exception HDF5LibraryException
8018      *                - Error from the HDF-5 Library.
8019      **/
H5PLinsert(String plugin_path, int index)8020     public synchronized static native void H5PLinsert(String plugin_path, int index) throws HDF5LibraryException;
8021 
8022     /**
8023      * H5PLremove removes the plugin path at the specified index.
8024      *
8025      * @param index
8026      *            IN: The table index (0-based).
8027      *
8028      * @exception HDF5LibraryException
8029      *                - Error from the HDF-5 Library.
8030      **/
H5PLremove(int index)8031     public synchronized static native void H5PLremove(int index) throws HDF5LibraryException;
8032 
8033     /**
8034      * H5PLget retrieves the plugin path at the specified index.
8035      *
8036      * @param index
8037      *            IN: The table index (0-based).
8038      *
8039      * @return the current path at the index in plugin path table
8040      *
8041      * @exception HDF5LibraryException
8042      *                - Error from the HDF-5 Library.
8043      **/
H5PLget(int index)8044     public synchronized static native String H5PLget(int index) throws HDF5LibraryException;
8045 
8046     /**
8047      * H5PLsize retrieves the size of the current list of plugin paths.
8048      *
8049      * @return the current number of paths in the plugin path table
8050      *
8051      * @exception HDF5LibraryException
8052      *                - Error from the HDF-5 Library.
8053      **/
H5PLsize()8054     public synchronized static native int H5PLsize() throws HDF5LibraryException;
8055 
8056     // ////////////////////////////////////////////////////////////
8057     // //
8058     // H5R: HDF5 1.8 Reference API Functions //
8059     // //
8060     // ////////////////////////////////////////////////////////////
8061 
H5Rcreate(byte[] ref, long loc_id, String name, int ref_type, long space_id)8062     private synchronized static native int H5Rcreate(byte[] ref, long loc_id, String name, int ref_type, long space_id)
8063             throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
8064 
8065     /**
8066      * H5Rcreate creates the reference, ref, of the type specified in ref_type, pointing to the object name located at
8067      * loc_id.
8068      *
8069      * @param loc_id
8070      *            IN: Location identifier used to locate the object being pointed to.
8071      * @param name
8072      *            IN: Name of object at location loc_id.
8073      * @param ref_type
8074      *            IN: Type of reference.
8075      * @param space_id
8076      *            IN: Dataspace identifier with selection.
8077      *
8078      * @return the reference (byte[]) if successful
8079      *
8080      * @exception HDF5LibraryException
8081      *                - Error from the HDF-5 Library.
8082      * @exception NullPointerException
8083      *                - an input array is null.
8084      * @exception IllegalArgumentException
8085      *                - an input array is invalid.
8086      **/
H5Rcreate(long loc_id, String name, int ref_type, long space_id)8087     public synchronized static byte[] H5Rcreate(long loc_id, String name, int ref_type, long space_id)
8088             throws HDF5LibraryException, NullPointerException, IllegalArgumentException {
8089         /* These sizes are correct for HDF5.1.2 */
8090         int ref_size = 8;
8091         if (ref_type == HDF5Constants.H5R_DATASET_REGION) {
8092             ref_size = 12;
8093         }
8094         byte rbuf[] = new byte[ref_size];
8095 
8096         /* will raise an exception if fails */
8097         H5Rcreate(rbuf, loc_id, name, ref_type, space_id);
8098 
8099         return rbuf;
8100     }
8101 
8102     /**
8103      * Given a reference to some object, H5Rdereference opens that object and return an identifier.
8104      *
8105      * @param dataset
8106      *            IN: Dataset containing reference object.
8107      * @param access_list
8108      *            IN: Property list of the object being referenced.
8109      * @param ref_type
8110      *            IN: The reference type of ref.
8111      * @param ref
8112      *            IN: reference to an object
8113      *
8114      * @return valid identifier if successful
8115      *
8116      * @exception HDF5LibraryException
8117      *                - Error from the HDF-5 Library.
8118      * @exception NullPointerException
8119      *                - output array is null.
8120      * @exception IllegalArgumentException
8121      *                - output array is invalid.
8122      **/
H5Rdereference(long dataset, long access_list, int ref_type, byte[] ref)8123     public static long H5Rdereference(long dataset, long access_list, int ref_type, byte[] ref)
8124             throws HDF5LibraryException, NullPointerException, IllegalArgumentException {
8125         long id = _H5Rdereference(dataset, access_list, ref_type, ref);
8126         if (id > 0) {
8127             log.trace("OPEN_IDS: H5Rdereference add {}", id);
8128             OPEN_IDS.add(id);
8129             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
8130         }
8131         return id;
8132     }
8133 
_H5Rdereference(long dataset, long access_list, int ref_type, byte[] ref)8134     private synchronized static native long _H5Rdereference(long dataset, long access_list, int ref_type, byte[] ref)
8135             throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
8136 
8137     /**
8138      * H5Rget_name retrieves a name for the object identified by ref.
8139      *
8140      * @param loc_id
8141      *            IN: Identifier for the dataset containing the reference or for the group that dataset is in.
8142      * @param ref_type
8143      *            IN: Type of reference.
8144      * @param ref
8145      *            IN: An object or dataset region reference.
8146      * @param name
8147      *            OUT: A name associated with the referenced object or dataset region.
8148      * @param size
8149      *            IN: The size of the name buffer.
8150      *
8151      * @return Returns the length of the name if successful, returning 0 (zero) if no name is associated with the
8152      *         identifier. Otherwise returns a negative value.
8153      *
8154      *
8155      * @exception HDF5LibraryException
8156      *                - Error from the HDF-5 Library.
8157      * @exception NullPointerException
8158      *                - size is null.
8159      * @exception IllegalArgumentException
8160      *                - Argument is illegal.
8161      *
8162      **/
H5Rget_name(long loc_id, int ref_type, byte[] ref, String[] name, long size)8163     public synchronized static native long H5Rget_name(long loc_id, int ref_type, byte[] ref, String[] name, long size)
8164             throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
8165 
8166     /**
8167      * H5Rget_obj_type Given a reference to an object ref, H5Rget_obj_type returns the type of the object pointed to.
8168      *
8169      * @param loc_id
8170      *            IN: loc_id of the reference object.
8171      * @param ref_type
8172      *            IN: Type of reference to query.
8173      * @param ref
8174      *            IN: the reference
8175      *
8176      * @return Returns the object type
8177      *
8178      * @exception HDF5LibraryException
8179      *                - Error from the HDF-5 Library.
8180      * @exception NullPointerException
8181      *                - array is null.
8182      * @exception IllegalArgumentException
8183      *                - array is invalid.
8184      **/
H5Rget_obj_type(long loc_id, int ref_type, byte ref[])8185     public synchronized static native int H5Rget_obj_type(long loc_id, int ref_type, byte ref[])
8186             throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
8187 
8188     /**
8189      * H5Rget_obj_type2 Retrieves the type of object that an object reference points to.
8190      *
8191      * @see public static int H5Rget_obj_type(int loc_id, int ref_type, byte ref[])
8192      **/
H5Rget_obj_type2(long loc_id, int ref_type, byte ref[], int[] obj_type)8193     private synchronized static native int H5Rget_obj_type2(long loc_id, int ref_type, byte ref[], int[] obj_type)
8194             throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
8195 
8196     /**
8197      * Given a reference to an object ref, H5Rget_region creates a copy of the dataspace of the dataset pointed to and
8198      * defines a selection in the copy which is the region pointed to.
8199      *
8200      * @param loc_id
8201      *            IN: loc_id of the reference object.
8202      * @param ref_type
8203      *            IN: The reference type of ref.
8204      * @param ref
8205      *            OUT: the reference to the object and region
8206      *
8207      * @return a valid identifier if successful
8208      *
8209      * @exception HDF5LibraryException
8210      *                - Error from the HDF-5 Library.
8211      * @exception NullPointerException
8212      *                - output array is null.
8213      * @exception IllegalArgumentException
8214      *                - output array is invalid.
8215      **/
H5Rget_region(long loc_id, int ref_type, byte[] ref)8216     public static long H5Rget_region(long loc_id, int ref_type, byte[] ref) throws HDF5LibraryException,
8217     NullPointerException, IllegalArgumentException {
8218         long id = _H5Rget_region(loc_id, ref_type, ref);
8219         if (id > 0) {
8220             log.trace("OPEN_IDS: H5Rget_region add {}", id);
8221             OPEN_IDS.add(id);
8222             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
8223         }
8224         return id;
8225     }
8226 
_H5Rget_region(long loc_id, int ref_type, byte[] ref)8227     private synchronized static native long _H5Rget_region(long loc_id, int ref_type, byte[] ref)
8228             throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
8229 
8230     // ////////////////////////////////////////////////////////////
8231     // //
8232     // H5S: Dataspace Interface Functions //
8233     // //
8234     // ////////////////////////////////////////////////////////////
8235 
8236     /**
8237      * H5Sclose releases a dataspace.
8238      *
8239      * @param space_id
8240      *            Identifier of dataspace to release.
8241      *
8242      * @return a non-negative value if successful
8243      *
8244      * @exception HDF5LibraryException
8245      *                - Error from the HDF-5 Library.
8246      **/
H5Sclose(long space_id)8247     public static int H5Sclose(long space_id) throws HDF5LibraryException {
8248         if (space_id < 0)
8249             return 0; // throw new HDF5LibraryException("Negative ID");;
8250 
8251         log.trace("OPEN_IDS: H5Sclose remove {}", space_id);
8252         OPEN_IDS.remove(space_id);
8253         log.trace("OPEN_IDS: {}", OPEN_IDS.size());
8254         return _H5Sclose(space_id);
8255     }
8256 
_H5Sclose(long space_id)8257     private synchronized static native int _H5Sclose(long space_id) throws HDF5LibraryException;
8258 
8259     /**
8260      * H5Scopy creates a new dataspace which is an exact copy of the dataspace identified by space_id.
8261      *
8262      * @param space_id
8263      *            Identifier of dataspace to copy.
8264      * @return a dataspace identifier if successful
8265      *
8266      * @exception HDF5LibraryException
8267      *                - Error from the HDF-5 Library.
8268      **/
H5Scopy(long space_id)8269     public static long H5Scopy(long space_id) throws HDF5LibraryException {
8270         long id = _H5Scopy(space_id);
8271         if (id > 0) {
8272             log.trace("OPEN_IDS: H5Scopy add {}", id);
8273             OPEN_IDS.add(id);
8274             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
8275         }
8276         return id;
8277     }
8278 
_H5Scopy(long space_id)8279     private synchronized static native long _H5Scopy(long space_id) throws HDF5LibraryException;
8280 
8281     /**
8282      * H5Screate creates a new dataspace of a particular type.
8283      *
8284      * @param type
8285      *            IN: The type of dataspace to be created.
8286      *
8287      * @return a dataspace identifier
8288      *
8289      * @exception HDF5LibraryException
8290      *                - Error from the HDF-5 Library.
8291      **/
H5Screate(int type)8292     public static long H5Screate(int type) throws HDF5LibraryException {
8293         long id = _H5Screate(type);
8294         if (id > 0) {
8295             log.trace("OPEN_IDS: H5Screate add {}", id);
8296             OPEN_IDS.add(id);
8297             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
8298         }
8299         return id;
8300     }
8301 
_H5Screate(int type)8302     private synchronized static native long _H5Screate(int type) throws HDF5LibraryException;
8303 
8304     /**
8305      * H5Screate_simple creates a new simple data space and opens it for access.
8306      *
8307      * @param rank
8308      *            IN: Number of dimensions of dataspace.
8309      * @param dims
8310      *            IN: An array of the size of each dimension.
8311      * @param maxdims
8312      *            IN: An array of the maximum size of each dimension.
8313      *
8314      * @return a dataspace identifier
8315      *
8316      * @exception HDF5Exception
8317      *                - Error from the HDF-5 Library.
8318      * @exception NullPointerException
8319      *                - dims or maxdims is null.
8320      **/
H5Screate_simple(int rank, long[] dims, long[] maxdims)8321     public static long H5Screate_simple(int rank, long[] dims, long[] maxdims) throws HDF5Exception,
8322             NullPointerException {
8323         long id = _H5Screate_simple(rank, dims, maxdims);
8324         if (id > 0) {
8325             log.trace("OPEN_IDS: H5Screate_simple add {}", id);
8326             OPEN_IDS.add(id);
8327             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
8328         }
8329         return id;
8330     }
8331 
_H5Screate_simple(int rank, long[] dims, long[] maxdims)8332     private synchronized static native long _H5Screate_simple(int rank, long[] dims, long[] maxdims)
8333             throws HDF5Exception, NullPointerException;
8334 
8335     /**
8336      * H5Sdecode reconstructs the HDF5 data space object and returns a new object handle for it.
8337      *
8338      * @param buf
8339      *            IN: Buffer for the data space object to be decoded.
8340      *
8341      * @return a new object handle
8342      *
8343      * @exception HDF5LibraryException
8344      *                - Error from the HDF-5 Library.
8345      * @exception NullPointerException
8346      *                - buf is null.
8347      **/
H5Sdecode(byte[] buf)8348     public synchronized static native long H5Sdecode(byte[] buf) throws HDF5LibraryException, NullPointerException;
8349 
8350     /**
8351      * H5Sencode converts a data space description into binary form in a buffer.
8352      *
8353      * @param obj_id
8354      *            IN: Identifier of the object to be encoded.
8355      *
8356      * @return the buffer for the object to be encoded into.
8357      *
8358      * @exception HDF5LibraryException
8359      *                - Error from the HDF-5 Library.
8360      **/
H5Sencode(long obj_id)8361     public synchronized static native byte[] H5Sencode(long obj_id) throws HDF5LibraryException, NullPointerException;
8362 
8363     /**
8364      * H5Sextent_copy copies the extent from source_space_id to dest_space_id. This action may change the type of the
8365      * dataspace.
8366      *
8367      * @param dest_space_id
8368      *            IN: The identifier for the dataspace from which the extent is copied.
8369      * @param source_space_id
8370      *            IN: The identifier for the dataspace to which the extent is copied.
8371      *
8372      * @return a non-negative value if successful
8373      *
8374      * @exception HDF5LibraryException
8375      *                - Error from the HDF-5 Library.
8376      **/
H5Sextent_copy(long dest_space_id, long source_space_id)8377     public synchronized static native int H5Sextent_copy(long dest_space_id, long source_space_id)
8378             throws HDF5LibraryException;
8379 
8380     /**
8381      * H5Sextent_equal determines whether the dataspace extents of two dataspaces, space1_id and space2_id, are equal.
8382      *
8383      * @param first_space_id
8384      *            IN: The identifier for the first dataspace.
8385      * @param second_space_id
8386      *            IN: The identifier for the seconddataspace.
8387      *
8388      * @return true if successful, else false
8389      *
8390      * @exception HDF5LibraryException
8391      *                - Error from the HDF-5 Library.
8392      **/
H5Sextent_equal(long first_space_id, long second_space_id)8393     public synchronized static native boolean H5Sextent_equal(long first_space_id, long second_space_id)
8394             throws HDF5LibraryException;
8395 
8396     /**
8397      * H5Sget_select_bounds retrieves the coordinates of the bounding box containing the current selection and places
8398      * them into user-supplied buffers.
8399      * <P>
8400      * The start and end buffers must be large enough to hold the dataspace rank number of coordinates.
8401      *
8402      * @param spaceid
8403      *            Identifier of dataspace to release.
8404      * @param start
8405      *            coordinates of lowest corner of bounding box.
8406      * @param end
8407      *            coordinates of highest corner of bounding box.
8408      *
8409      * @return a non-negative value if successful,with start and end initialized.
8410      *
8411      * @exception HDF5LibraryException
8412      *                - Error from the HDF-5 Library.
8413      * @exception NullPointerException
8414      *                - start or end is null.
8415      **/
H5Sget_select_bounds(long spaceid, long[] start, long[] end)8416     public synchronized static native int H5Sget_select_bounds(long spaceid, long[] start, long[] end)
8417             throws HDF5LibraryException, NullPointerException;
8418 
8419     /**
8420      * H5Sget_select_elem_npoints returns the number of element points in the current dataspace selection.
8421      *
8422      * @param spaceid
8423      *            Identifier of dataspace to release.
8424      *
8425      * @return a non-negative value if successful
8426      *
8427      * @exception HDF5LibraryException
8428      *                - Error from the HDF-5 Library.
8429      **/
H5Sget_select_elem_npoints(long spaceid)8430     public synchronized static native long H5Sget_select_elem_npoints(long spaceid) throws HDF5LibraryException;
8431 
8432     /**
8433      * H5Sget_select_elem_pointlist returns an array of of element points in the current dataspace selection. The point
8434      * coordinates have the same dimensionality (rank) as the dataspace they are located within, one coordinate per
8435      * point.
8436      *
8437      * @param spaceid
8438      *            Identifier of dataspace to release.
8439      * @param startpoint
8440      *            first point to retrieve
8441      * @param numpoints
8442      *            number of points to retrieve
8443      * @param buf
8444      *            returns points startblock to startblock+num-1, each points is <i>rank</i> longs.
8445      *
8446      * @return a non-negative value if successful
8447      *
8448      * @exception HDF5LibraryException
8449      *                - Error from the HDF-5 Library.
8450      * @exception NullPointerException
8451      *                - buf is null.
8452      **/
H5Sget_select_elem_pointlist(long spaceid, long startpoint, long numpoints, long[] buf)8453     public synchronized static native int H5Sget_select_elem_pointlist(long spaceid, long startpoint, long numpoints,
8454             long[] buf) throws HDF5LibraryException, NullPointerException;
8455 
8456     /**
8457      * H5Sget_select_hyper_blocklist returns an array of hyperslab blocks. The block coordinates have the same
8458      * dimensionality (rank) as the dataspace they are located within. The list of blocks is formatted as follows:
8459      *
8460      * <pre>
8461      *    &lt;"start" coordinate&gt;, immediately followed by
8462      *    &lt;"opposite" corner coordinate&gt;, followed by
8463      *   the next "start" and "opposite" coordinates,
8464      *   etc.
8465      *   until all of the selected blocks have been listed.
8466      * </pre>
8467      *
8468      * @param spaceid
8469      *            Identifier of dataspace to release.
8470      * @param startblock
8471      *            first block to retrieve
8472      * @param numblocks
8473      *            number of blocks to retrieve
8474      * @param buf
8475      *            returns blocks startblock to startblock+num-1, each block is <i>rank</i> * 2 (corners) longs.
8476      *
8477      * @return a non-negative value if successful
8478      *
8479      * @exception HDF5LibraryException
8480      *                - Error from the HDF-5 Library.
8481      * @exception NullPointerException
8482      *                - buf is null.
8483      **/
H5Sget_select_hyper_blocklist(long spaceid, long startblock, long numblocks, long[] buf)8484     public synchronized static native int H5Sget_select_hyper_blocklist(long spaceid, long startblock, long numblocks,
8485             long[] buf) throws HDF5LibraryException, NullPointerException;
8486 
8487     /**
8488      * H5Sget_select_hyper_nblocks returns the number of hyperslab blocks in the current dataspace selection.
8489      *
8490      * @param spaceid
8491      *            Identifier of dataspace to release.
8492      *
8493      * @return a non-negative value if successful
8494      *
8495      * @exception HDF5LibraryException
8496      *                - Error from the HDF-5 Library.
8497      **/
H5Sget_select_hyper_nblocks(long spaceid)8498     public synchronized static native long H5Sget_select_hyper_nblocks(long spaceid) throws HDF5LibraryException;
8499 
8500     /**
8501      * H5Sget_select_npoints determines the number of elements in the current selection of a dataspace.
8502      *
8503      * @param space_id
8504      *            IN: Identifier of the dataspace object to query
8505      *
8506      * @return the number of elements in the selection if successful
8507      *
8508      * @exception HDF5LibraryException
8509      *                - Error from the HDF-5 Library.
8510      **/
H5Sget_select_npoints(long space_id)8511     public synchronized static native long H5Sget_select_npoints(long space_id) throws HDF5LibraryException;
8512 
8513     /**
8514      * H5Sget_select_type retrieves the type of selection currently defined for the dataspace space_id.
8515      *
8516      * @param space_id
8517      *            IN: Identifier of the dataspace object to query
8518      *
8519      * @return the dataspace selection type if successful
8520      *
8521      * @exception HDF5LibraryException
8522      *                - Error from the HDF-5 Library.
8523      **/
H5Sget_select_type(long space_id)8524     public synchronized static native int H5Sget_select_type(long space_id) throws HDF5LibraryException;
8525 
8526     /**
8527      * H5Sget_simple_extent_dims returns the size and maximum sizes of each dimension of a dataspace through the dims
8528      * and maxdims parameters.
8529      *
8530      * @param space_id
8531      *            IN: Identifier of the dataspace object to query
8532      * @param dims
8533      *            OUT: Pointer to array to store the size of each dimension.
8534      * @param maxdims
8535      *            OUT: Pointer to array to store the maximum size of each dimension.
8536      *
8537      * @return the number of dimensions in the dataspace if successful
8538      *
8539      * @exception HDF5LibraryException
8540      *                - Error from the HDF-5 Library.
8541      * @exception NullPointerException
8542      *                - dims or maxdims is null.
8543      **/
H5Sget_simple_extent_dims(long space_id, long[] dims, long[] maxdims)8544     public synchronized static native int H5Sget_simple_extent_dims(long space_id, long[] dims, long[] maxdims)
8545             throws HDF5LibraryException, NullPointerException;
8546 
8547     /**
8548      * H5Sget_simple_extent_ndims determines the dimensionality (or rank) of a dataspace.
8549      *
8550      * @param space_id
8551      *            IN: Identifier of the dataspace
8552      *
8553      * @return the number of dimensions in the dataspace if successful
8554      *
8555      * @exception HDF5LibraryException
8556      *                - Error from the HDF-5 Library.
8557      **/
H5Sget_simple_extent_ndims(long space_id)8558     public synchronized static native int H5Sget_simple_extent_ndims(long space_id) throws HDF5LibraryException;
8559 
8560     /**
8561      * H5Sget_simple_extent_npoints determines the number of elements in a dataspace.
8562      *
8563      * @param space_id
8564      *            ID of the dataspace object to query
8565      * @return the number of elements in the dataspace if successful
8566      *
8567      * @exception HDF5LibraryException
8568      *                - Error from the HDF-5 Library.
8569      **/
H5Sget_simple_extent_npoints(long space_id)8570     public synchronized static native long H5Sget_simple_extent_npoints(long space_id) throws HDF5LibraryException;
8571 
8572     /**
8573      * H5Sget_simple_extent_type queries a dataspace to determine the current class of a dataspace.
8574      *
8575      * @param space_id
8576      *            Dataspace identifier.
8577      *
8578      * @return a dataspace class name if successful
8579      *
8580      * @exception HDF5LibraryException
8581      *                - Error from the HDF-5 Library.
8582      **/
H5Sget_simple_extent_type(long space_id)8583     public synchronized static native int H5Sget_simple_extent_type(long space_id) throws HDF5LibraryException;
8584 
8585     /**
8586      * H5Sis_simple determines whether a dataspace is a simple dataspace.
8587      *
8588      * @param space_id
8589      *            Identifier of the dataspace to query
8590      *
8591      * @return true if is a simple dataspace
8592      *
8593      * @exception HDF5LibraryException
8594      *                - Error from the HDF-5 Library.
8595      **/
H5Sis_simple(long space_id)8596     public synchronized static native boolean H5Sis_simple(long space_id) throws HDF5LibraryException;
8597 
8598     /**
8599      * H5Soffset_simple sets the offset of a simple dataspace space_id.
8600      *
8601      * @param space_id
8602      *            IN: The identifier for the dataspace object to reset.
8603      * @param offset
8604      *            IN: The offset at which to position the selection.
8605      *
8606      * @return a non-negative value if successful
8607      *
8608      * @exception HDF5LibraryException
8609      *                - Error from the HDF-5 Library.
8610      * @exception NullPointerException
8611      *                - offset array is null.
8612      **/
H5Soffset_simple(long space_id, byte[] offset)8613     public synchronized static native int H5Soffset_simple(long space_id, byte[] offset) throws HDF5LibraryException,
8614             NullPointerException;
8615 
H5Soffset_simple(long space_id, long[] offset)8616     public synchronized static int H5Soffset_simple(long space_id, long[] offset) throws HDF5Exception,
8617             NullPointerException {
8618         if (offset == null) {
8619             return -1;
8620         }
8621 
8622         HDFArray theArray = new HDFArray(offset);
8623         byte[] theArr = theArray.byteify();
8624 
8625         int retVal = H5Soffset_simple(space_id, theArr);
8626 
8627         theArr = null;
8628         theArray = null;
8629         return retVal;
8630     }
8631 
8632     /**
8633      * H5Sselect_all selects the entire extent of the dataspace space_id.
8634      *
8635      * @param space_id
8636      *            IN: The identifier of the dataspace to be selected.
8637      *
8638      * @return a non-negative value if successful
8639      *
8640      * @exception HDF5LibraryException
8641      *                - Error from the HDF-5 Library.
8642      **/
H5Sselect_all(long space_id)8643     public synchronized static native int H5Sselect_all(long space_id) throws HDF5LibraryException;
8644 
8645     /**
8646      * H5Sselect_elements selects array elements to be included in the selection for the space_id dataspace.
8647      *
8648      * @param space_id
8649      *            Identifier of the dataspace.
8650      * @param op
8651      *            operator specifying how the new selection is combined.
8652      * @param num_elements
8653      *            Number of elements to be selected.
8654      * @param coord
8655      *            A 2-dimensional array specifying the coordinates of the elements.
8656      *
8657      * @return a non-negative value if successful
8658      *
8659      * @exception HDF5LibraryException
8660      *                - Error from the HDF-5 Library.
8661      **/
H5Sselect_elements(long space_id, int op, int num_elements, byte[] coord)8662     private synchronized static native int H5Sselect_elements(long space_id, int op, int num_elements, byte[] coord)
8663             throws HDF5LibraryException, NullPointerException;
8664 
8665     /**
8666      * H5Sselect_elements selects array elements to be included in the selection for the space_id dataspace.
8667      *
8668      * @param space_id
8669      *            Identifier of the dataspace.
8670      * @param op
8671      *            operator specifying how the new selection is combined.
8672      * @param num_elements
8673      *            Number of elements to be selected.
8674      * @param coord2D
8675      *            A 2-dimensional array specifying the coordinates of the elements.
8676      *
8677      * @return a non-negative value if successful
8678      *
8679      * @exception HDF5Exception
8680      *                - Error in the data conversion
8681      * @exception HDF5LibraryException
8682      *                - Error from the HDF-5 Library.
8683      * @exception NullPointerException
8684      *                - cord array is
8685      **/
H5Sselect_elements(long space_id, int op, int num_elements, long[][] coord2D)8686     public synchronized static int H5Sselect_elements(long space_id, int op, int num_elements, long[][] coord2D)
8687             throws HDF5Exception, HDF5LibraryException, NullPointerException {
8688         if (coord2D == null) {
8689             return -1;
8690         }
8691 
8692         HDFArray theArray = new HDFArray(coord2D);
8693         byte[] coord = theArray.byteify();
8694 
8695         int retVal = H5Sselect_elements(space_id, op, num_elements, coord);
8696 
8697         coord = null;
8698         theArray = null;
8699         return retVal;
8700     }
8701 
8702     /**
8703      * H5Sselect_hyperslab selects a hyperslab region to add to the current selected region for the dataspace specified
8704      * by space_id. The start, stride, count, and block arrays must be the same size as the rank of the dataspace.
8705      *
8706      * @param space_id
8707      *            IN: Identifier of dataspace selection to modify
8708      * @param op
8709      *            IN: Operation to perform on current selection.
8710      * @param start
8711      *            IN: Offset of start of hyperslab
8712      * @param stride
8713      *            IN: Hyperslab stride.
8714      * @param count
8715      *            IN: Number of blocks included in hyperslab.
8716      * @param block
8717      *            IN: Size of block in hyperslab.
8718      *
8719      * @return a non-negative value if successful
8720      *
8721      * @exception HDF5LibraryException
8722      *                - Error from the HDF-5 Library.
8723      * @exception NullPointerException
8724      *                - an input array is null.
8725      * @exception IllegalArgumentException
8726      *                - an input array is invalid.
8727      **/
H5Sselect_hyperslab(long space_id, int op, byte[] start, byte[] stride, byte[] count, byte[] block)8728     public synchronized static int H5Sselect_hyperslab(long space_id, int op, byte[] start, byte[] stride,
8729             byte[] count, byte[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException {
8730         ByteBuffer startbb = ByteBuffer.wrap(start);
8731         long[] lastart = (startbb.asLongBuffer()).array();
8732         ByteBuffer stridebb = ByteBuffer.wrap(stride);
8733         long[] lastride = (stridebb.asLongBuffer()).array();
8734         ByteBuffer countbb = ByteBuffer.wrap(count);
8735         long[] lacount = (countbb.asLongBuffer()).array();
8736         ByteBuffer blockbb = ByteBuffer.wrap(block);
8737         long[] lablock = (blockbb.asLongBuffer()).array();
8738 
8739         return H5Sselect_hyperslab(space_id, op, lastart, lastride, lacount, lablock);
8740     }
8741 
H5Sselect_hyperslab(long space_id, int op, long[] start, long[] stride, long[] count, long[] block)8742     public synchronized static native int H5Sselect_hyperslab(long space_id, int op, long[] start, long[] stride,
8743             long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
8744 
8745     /**
8746      * H5Sselect_none resets the selection region for the dataspace space_id to include no elements.
8747      *
8748      * @param space_id
8749      *            IN: The identifier of the dataspace to be reset.
8750      * @return a non-negative value if successful
8751      *
8752      * @exception HDF5LibraryException
8753      *                - Error from the HDF-5 Library.
8754      **/
H5Sselect_none(long space_id)8755     public synchronized static native int H5Sselect_none(long space_id) throws HDF5LibraryException;
8756 
8757     /**
8758      * H5Sselect_valid verifies that the selection for the dataspace.
8759      *
8760      * @param space_id
8761      *            The identifier for the dataspace in which the selection is being reset.
8762      *
8763      * @return true if the selection is contained within the extent and FALSE if it is not or is an error.
8764      *
8765      * @exception HDF5LibraryException
8766      *                - Error from the HDF-5 Library.
8767      **/
H5Sselect_valid(long space_id)8768     public synchronized static native boolean H5Sselect_valid(long space_id) throws HDF5LibraryException;
8769 
8770     /**
8771      * H5Sset_extent_none removes the extent from a dataspace and sets the type to H5S_NONE.
8772      *
8773      * @param space_id
8774      *            The identifier for the dataspace from which the extent is to be removed.
8775      *
8776      * @return a non-negative value if successful
8777      *
8778      * @exception HDF5LibraryException
8779      *                - Error from the HDF-5 Library.
8780      **/
H5Sset_extent_none(long space_id)8781     public synchronized static native int H5Sset_extent_none(long space_id) throws HDF5LibraryException;
8782 
8783     /**
8784      * H5Sset_extent_simple sets or resets the size of an existing dataspace.
8785      *
8786      * @param space_id
8787      *            Dataspace identifier.
8788      * @param rank
8789      *            Rank, or dimensionality, of the dataspace.
8790      * @param current_size
8791      *            Array containing current size of dataspace.
8792      * @param maximum_size
8793      *            Array containing maximum size of dataspace.
8794      *
8795      * @return a dataspace identifier if successful
8796      *
8797      * @exception HDF5LibraryException
8798      *                - Error from the HDF-5 Library.
8799      **/
H5Sset_extent_simple(long space_id, int rank, long[] current_size, long[] maximum_size)8800     public synchronized static native long H5Sset_extent_simple(long space_id, int rank, long[] current_size,
8801             long[] maximum_size) throws HDF5LibraryException, NullPointerException;
8802 
H5Sset_extent_simple(long space_id, int rank, byte[] current_size, byte[] maximum_size)8803     public synchronized static long H5Sset_extent_simple(long space_id, int rank, byte[] current_size,
8804             byte[] maximum_size) throws HDF5LibraryException, NullPointerException {
8805         ByteBuffer csbb = ByteBuffer.wrap(current_size);
8806         long[] lacs = (csbb.asLongBuffer()).array();
8807         ByteBuffer maxsbb = ByteBuffer.wrap(maximum_size);
8808         long[] lamaxs = (maxsbb.asLongBuffer()).array();
8809 
8810         return H5Sset_extent_simple(space_id, rank, lacs, lamaxs);
8811     }
8812 
8813     /**
8814      * H5Sget_regular_hyperslab determines if a hyperslab selection is regular for the dataspace specified
8815      * by space_id. The start, stride, count, and block arrays must be the same size as the rank of the dataspace.
8816      *
8817      * @param space_id
8818      *            IN: Identifier of dataspace selection to modify
8819      * @param start
8820      *           OUT: Offset of start of hyperslab
8821      * @param stride
8822      *           OUT: Hyperslab stride.
8823      * @param count
8824      *           OUT: Number of blocks included in hyperslab.
8825      * @param block
8826      *           OUT: Size of block in hyperslab.
8827      *
8828      * @exception HDF5LibraryException
8829      *                - Error from the HDF-5 Library.
8830      * @exception NullPointerException
8831      *                - an output array is null.
8832      * @exception IllegalArgumentException
8833      *                - an output array is invalid.
8834      **/
H5Sget_regular_hyperslab(long space_id, long[] start, long[] stride, long[] count, long[] block)8835      public synchronized static native void H5Sget_regular_hyperslab(long space_id, long[] start, long[] stride, long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
8836 
8837     /**
8838      * H5Sis_regular_hyperslab retrieves a regular hyperslab selection for the dataspace specified
8839      * by space_id.
8840      *
8841      * @param space_id
8842      *            IN: Identifier of dataspace selection to query
8843      *
8844      * @return a TRUE/FALSE for hyperslab selection if successful
8845      *
8846      * @exception HDF5LibraryException
8847      *                - Error from the HDF-5 Library.
8848      **/
H5Sis_regular_hyperslab(long space_id)8849      public synchronized static native boolean H5Sis_regular_hyperslab(long space_id) throws HDF5LibraryException;
8850 
8851     // /////// unimplemented ////////
8852     // #ifdef NEW_HYPERSLAB_API
8853     //  hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op,
8854     //                                  const hsize_t start[],
8855     //                                  const hsize_t _stride[],
8856     //                                  const hsize_t count[],
8857     //                                  const hsize_t _block[]);
8858     // herr_t H5Sselect_select(hid_t space1_id, H5S_seloper_t op,
8859     //                                  hid_t space2_id);
8860     // hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op,
8861     //                                  hid_t space2_id);
8862     // #endif /* NEW_HYPERSLAB_API */
8863 
8864 
8865 
8866     // ////////////////////////////////////////////////////////////
8867     // //
8868     // H5T: Datatype Interface Functions //
8869     // //
8870     // ////////////////////////////////////////////////////////////
8871 
8872     /**
8873      * H5Tarray_create creates a new array datatype object.
8874      *
8875      * @param base_id
8876      *            IN: Datatype identifier for the array base datatype.
8877      * @param ndims
8878      *            IN: Rank of the array.
8879      * @param dim
8880      *            IN: Size of each array dimension.
8881      *
8882      * @return a valid datatype identifier
8883      *
8884      * @exception HDF5LibraryException
8885      *                - Error from the HDF-5 Library.
8886      * @exception NullPointerException
8887      *                - dim is null.
8888      **/
H5Tarray_create(long base_id, int ndims, long[] dim)8889     public static long H5Tarray_create(long base_id, int ndims, long[] dim) throws HDF5LibraryException,
8890             NullPointerException {
8891         long id = _H5Tarray_create2(base_id, ndims, dim);
8892         if (id > 0) {
8893             log.trace("OPEN_IDS: H5Tarray_create add {}", id);
8894             OPEN_IDS.add(id);
8895             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
8896         }
8897         return id;
8898     }
8899 
_H5Tarray_create2(long base_id, int ndims, long[] dim)8900     private synchronized static native long _H5Tarray_create2(long base_id, int ndims, long[] dim)
8901             throws HDF5LibraryException, NullPointerException;
8902 
8903     /**
8904      * H5Tclose releases a datatype.
8905      *
8906      * @param type_id
8907      *            IN: Identifier of datatype to release.
8908      *
8909      * @return a non-negative value if successful
8910      *
8911      * @exception HDF5LibraryException
8912      *                - Error from the HDF-5 Library.
8913      **/
H5Tclose(long type_id)8914     public static int H5Tclose(long type_id) throws HDF5LibraryException {
8915         if (type_id < 0)
8916             return 0; // throw new HDF5LibraryException("Negative ID");;
8917 
8918         log.trace("OPEN_IDS: H5Tclose remove {}", type_id);
8919         OPEN_IDS.remove(type_id);
8920         log.trace("OPEN_IDS: {}", OPEN_IDS.size());
8921         return _H5Tclose(type_id);
8922     }
8923 
_H5Tclose(long type_id)8924     private synchronized static native int _H5Tclose(long type_id) throws HDF5LibraryException;
8925 
8926     /**
8927      * H5Tcommit saves a transient datatype as an immutable named datatype in a file.
8928      *
8929      * @param loc_id
8930      *            IN: Location identifier.
8931      * @param name
8932      *            IN: Name given to committed datatype.
8933      * @param type_id
8934      *            IN: Identifier of datatype to be committed.
8935      * @param lcpl_id
8936      *            IN: Link creation property list.
8937      * @param tcpl_id
8938      *            IN: Datatype creation property list.
8939      * @param tapl_id
8940      *            IN: Datatype access property list.
8941      *
8942      * @exception HDF5LibraryException
8943      *                - Error from the HDF-5 Library.
8944      * @exception NullPointerException
8945      *                - name is null.
8946      **/
H5Tcommit(long loc_id, String name, long type_id, long lcpl_id, long tcpl_id, long tapl_id)8947     public synchronized static native void H5Tcommit(long loc_id, String name, long type_id, long lcpl_id,
8948             long tcpl_id, long tapl_id) throws HDF5LibraryException, NullPointerException;
8949 
8950     /**
8951      * H5Tcommit_anon commits a transient datatype (not immutable) to a file, turning it into a named datatype with the
8952      * specified creation and property lists.
8953      *
8954      * @param loc_id
8955      *            IN: Location identifier.
8956      * @param type_id
8957      *            IN: Identifier of datatype to be committed.
8958      * @param tcpl_id
8959      *            IN: Datatype creation property list.
8960      * @param tapl_id
8961      *            IN: Datatype access property list.
8962      *
8963      * @exception HDF5LibraryException
8964      *                - Error from the HDF-5 Library.
8965      **/
H5Tcommit_anon(long loc_id, long type_id, long tcpl_id, long tapl_id)8966     public synchronized static native void H5Tcommit_anon(long loc_id, long type_id, long tcpl_id, long tapl_id)
8967             throws HDF5LibraryException;
8968 
8969     /**
8970      * H5Tcommitted queries a type to determine whether the type specified by the type identifier is a named type or a
8971      * transient type.
8972      *
8973      * @param type_id
8974      *            IN: Identifier of datatype.
8975      *
8976      * @return true the datatype has been committed
8977      *
8978      * @exception HDF5LibraryException
8979      *                - Error from the HDF-5 Library.
8980      **/
H5Tcommitted(long type_id)8981     public synchronized static native boolean H5Tcommitted(long type_id) throws HDF5LibraryException;
8982 
8983     /**
8984      * H5Tcompiler_conv finds out whether the library's conversion function from type src_id to type dst_id is a
8985      * compiler (hard) conversion.
8986      *
8987      * @param src_id
8988      *            IN: Identifier of source datatype.
8989      * @param dst_id
8990      *            IN: Identifier of destination datatype.
8991      *
8992      * @exception HDF5LibraryException
8993      *                - Error from the HDF-5 Library.
8994      **/
H5Tcompiler_conv(long src_id, long dst_id)8995     public synchronized static native void H5Tcompiler_conv(long src_id, long dst_id) throws HDF5LibraryException;
8996 
8997     /**
8998      ** H5Tconvert converts nelmts elements from the type specified by the src_id identifier to type dst_id.
8999      *
9000      * @param src_id
9001      *            IN: Identifier of source datatype.
9002      * @param dst_id
9003      *            IN: Identifier of destination datatype.
9004      * @param nelmts
9005      *            IN: Size of array buf.
9006      * @param buf
9007      *            IN: Array containing pre- and post-conversion values.
9008      * @param background
9009      *            IN: Optional background buffer.
9010      * @param plist_id
9011      *            IN: Dataset transfer property list identifier.
9012      *
9013      * @exception HDF5LibraryException
9014      *                - Error from the HDF-5 Library.
9015      * @exception NullPointerException
9016      *                - buf is null.
9017      **/
H5Tconvert(long src_id, long dst_id, long nelmts, byte[] buf, byte[] background, long plist_id)9018     public synchronized static native void H5Tconvert(long src_id, long dst_id, long nelmts, byte[] buf,
9019             byte[] background, long plist_id) throws HDF5LibraryException, NullPointerException;
9020 
9021     // int H5Tconvert(int src_id, int dst_id, long nelmts, Pointer buf, Pointer background, int plist_id);
9022 
9023     /**
9024      * H5Tcopy copies an existing datatype. The returned type is always transient and unlocked.
9025      *
9026      * @param type_id
9027      *            IN: Identifier of datatype to copy. Can be a datatype identifier, a predefined datatype (defined in
9028      *            H5Tpublic.h), or a dataset Identifier.
9029      *
9030      * @return a datatype identifier if successful
9031      *
9032      * @exception HDF5LibraryException
9033      *                - Error from the HDF-5 Library.
9034      **/
H5Tcopy(long type_id)9035     public static long H5Tcopy(long type_id) throws HDF5LibraryException {
9036         long id = _H5Tcopy(type_id);
9037         if (id > 0) {
9038             log.trace("OPEN_IDS: H5Tcopy add {}", id);
9039             OPEN_IDS.add(id);
9040             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
9041         }
9042         return id;
9043     }
9044 
_H5Tcopy(long type_id)9045     private synchronized static native long _H5Tcopy(long type_id) throws HDF5LibraryException;
9046 
9047     /**
9048      * H5Tcreate creates a new dataype of the specified class with the specified number of bytes.
9049      *
9050      * @param tclass
9051      *            IN: Class of datatype to create.
9052      * @param size
9053      *            IN: The number of bytes in the datatype to create.
9054      *
9055      * @return datatype identifier
9056      *
9057      * @exception HDF5LibraryException
9058      *                - Error from the HDF-5 Library.
9059      **/
H5Tcreate(int tclass, long size)9060     public static long H5Tcreate(int tclass, long size) throws HDF5LibraryException {
9061         long id = _H5Tcreate(tclass, size);
9062         if (id > 0) {
9063             log.trace("OPEN_IDS: H5Tcreate add {}", id);
9064             OPEN_IDS.add(id);
9065             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
9066         }
9067         return id;
9068     }
9069 
_H5Tcreate(int type, long size)9070     private synchronized static native long _H5Tcreate(int type, long size) throws HDF5LibraryException;
9071 
9072     /**
9073      * H5Tdecode reconstructs the HDF5 data type object and returns a new object handle for it.
9074      *
9075      * @param buf
9076      *            IN: Buffer for the data type object to be decoded.
9077      *
9078      * @return a new object handle
9079      *
9080      * @exception HDF5LibraryException
9081      *                - Error from the HDF-5 Library.
9082      * @exception NullPointerException
9083      *                - buf is null.
9084      **/
H5Tdecode(byte[] buf)9085     public static long H5Tdecode(byte[] buf) throws HDF5LibraryException, NullPointerException {
9086         long id = _H5Tdecode(buf);
9087         if (id > 0) {
9088             log.trace("OPEN_IDS: H5Tdecode add {}", id);
9089             OPEN_IDS.add(id);
9090             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
9091         }
9092         return id;
9093     }
9094 
_H5Tdecode(byte[] buf)9095     private synchronized static native long _H5Tdecode(byte[] buf) throws HDF5LibraryException, NullPointerException;
9096 
9097     /**
9098      * H5Tdetect_class determines whether the datatype specified in dtype_id contains any datatypes of the datatype
9099      * class specified in dtype_class.
9100      *
9101      * @param type_id
9102      *            IN: Identifier of datatype to query.
9103      * @param cls
9104      *            IN: Identifier of datatype cls.
9105      *
9106      * @return true if the datatype specified in dtype_id contains any datatypes of the datatype class
9107      *
9108      * @exception HDF5LibraryException
9109      *                - Error from the HDF-5 Library.
9110      **/
H5Tdetect_class(long type_id, int cls)9111     public synchronized static native boolean H5Tdetect_class(long type_id, int cls) throws HDF5LibraryException;
9112 
9113     /**
9114      * H5Tencode converts a data type description into binary form in a buffer.
9115      *
9116      * @param obj_id
9117      *            IN: Identifier of the object to be encoded.
9118      * @param buf
9119      *            OUT: Buffer for the object to be encoded into. If the provided buffer is NULL, only the size of buffer
9120      *            needed is returned.
9121      * @param nalloc
9122      *            IN: The size of the allocated buffer.
9123      *
9124      * @return the size needed for the allocated buffer.
9125      *
9126      * @exception HDF5LibraryException
9127      *                - Error from the HDF-5 Library.
9128      * @exception NullPointerException
9129      *                - buf is null.
9130      **/
H5Tencode(long obj_id, byte[] buf, long nalloc)9131     public synchronized static native int H5Tencode(long obj_id, byte[] buf, long nalloc) throws HDF5LibraryException,
9132             NullPointerException;
9133 
9134     // /**
9135     // * H5Tencode converts a data type description into binary form in a buffer.
9136     // *
9137     // * @param obj_id IN: Identifier of the object to be encoded.
9138     // *
9139     // * @return the buffer for the object to be encoded into.
9140     // *
9141     // * @exception HDF5LibraryException - Error from the HDF-5 Library.
9142     // **/
9143     // public synchronized static native byte[] H5Tencode(int obj_id)
9144     // throws HDF5LibraryException;
9145 
9146     /**
9147      * H5Tenum_create creates a new enumeration datatype based on the specified base datatype, parent_id, which must be
9148      * an integer type.
9149      *
9150      * @param base_id
9151      *            IN: Identifier of the parent datatype to release.
9152      *
9153      * @return the datatype identifier for the new enumeration datatype
9154      *
9155      * @exception HDF5LibraryException
9156      *                - Error from the HDF-5 Library.
9157      **/
H5Tenum_create(long base_id)9158     public static long H5Tenum_create(long base_id) throws HDF5LibraryException {
9159         long id = _H5Tenum_create(base_id);
9160         if (id > 0) {
9161             log.trace("OPEN_IDS: H5Tenum_create add {}", id);
9162             OPEN_IDS.add(id);
9163             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
9164         }
9165         return id;
9166     }
9167 
_H5Tenum_create(long base_id)9168     private synchronized static native long _H5Tenum_create(long base_id) throws HDF5LibraryException;
9169 
9170     /**
9171      * H5Tenum_insert inserts a new enumeration datatype member into an enumeration datatype.
9172      *
9173      * @param type
9174      *            IN: Identifier of datatype.
9175      * @param name
9176      *            IN: The name of the member
9177      * @param value
9178      *            IN: The value of the member, data of the correct type
9179      *
9180      * @exception HDF5LibraryException
9181      *                - Error from the HDF-5 Library.
9182      * @exception NullPointerException
9183      *                - name is null.
9184      **/
H5Tenum_insert(long type, String name, byte[] value)9185     public synchronized static native void H5Tenum_insert(long type, String name, byte[] value)
9186             throws HDF5LibraryException, NullPointerException;
9187 
9188     /**
9189      * H5Tenum_insert inserts a new enumeration datatype member into an enumeration datatype.
9190      *
9191      * @param type
9192      *            IN: Identifier of datatype.
9193      * @param name
9194      *            IN: The name of the member
9195      * @param value
9196      *            IN: The value of the member, data of the correct type
9197      *
9198      * @return a non-negative value if successful
9199      *
9200      * @exception HDF5LibraryException
9201      *                - Error from the HDF-5 Library.
9202      * @exception NullPointerException
9203      *                - name is null.
9204      **/
H5Tenum_insert(long type, String name, int[] value)9205     public static int H5Tenum_insert(long type, String name, int[] value) throws HDF5LibraryException,
9206             NullPointerException {
9207         return H5Tenum_insert_int(type, name, value);
9208     }
9209 
H5Tenum_insert(long type, String name, int value)9210     public static int H5Tenum_insert(long type, String name, int value) throws HDF5LibraryException,
9211             NullPointerException {
9212         int[] val = { value };
9213         return H5Tenum_insert_int(type, name, val);
9214     }
9215 
H5Tenum_insert_int(long type, String name, int[] value)9216     private synchronized static native int H5Tenum_insert_int(long type, String name, int[] value)
9217             throws HDF5LibraryException, NullPointerException;
9218 
9219     /**
9220      * H5Tenum_nameof finds the symbol name that corresponds to the specified value of the enumeration datatype type.
9221      *
9222      * @param type
9223      *            IN: Identifier of datatype.
9224      * @param value
9225      *            IN: The value of the member, data of the correct
9226      * @param size
9227      *            IN: The probable length of the name
9228      *
9229      * @return the symbol name.
9230      *
9231      * @exception HDF5LibraryException
9232      *                - Error from the HDF-5 Library.
9233      * @exception NullPointerException
9234      *                - value is null.
9235      **/
H5Tenum_nameof(long type, byte[] value, long size)9236     public synchronized static native String H5Tenum_nameof(long type, byte[] value, long size)
9237             throws HDF5LibraryException, NullPointerException;
9238 
9239     // int H5Tenum_nameof(int type, Pointer value, Buffer name/* out */, long size);
9240 
9241     /**
9242      * H5Tenum_nameof finds the symbol name that corresponds to the specified value of the enumeration datatype type.
9243      *
9244      * @param type
9245      *            IN: Identifier of datatype.
9246      * @param value
9247      *            IN: The value of the member, data of the correct
9248      * @param name
9249      *            OUT: The name of the member
9250      * @param size
9251      *            IN: The max length of the name
9252      *
9253      * @return a non-negative value if successful
9254      *
9255      * @exception HDF5LibraryException
9256      *                - Error from the HDF-5 Library.
9257      * @exception NullPointerException
9258      *                - name is null.
9259      **/
H5Tenum_nameof(long type, int[] value, String[] name, int size)9260     public static int H5Tenum_nameof(long type, int[] value, String[] name, int size) throws HDF5LibraryException,
9261             NullPointerException {
9262         return H5Tenum_nameof_int(type, value, name, size);
9263     }
9264 
H5Tenum_nameof_int(long type, int[] value, String[] name, int size)9265     private synchronized static native int H5Tenum_nameof_int(long type, int[] value, String[] name, int size)
9266             throws HDF5LibraryException, NullPointerException;
9267 
9268     /**
9269      * H5Tenum_valueof finds the value that corresponds to the specified name of the enumeration datatype type.
9270      *
9271      * @param type
9272      *            IN: Identifier of datatype.
9273      * @param name
9274      *            IN: The name of the member
9275      * @param value
9276      *            OUT: The value of the member
9277      *
9278      * @exception HDF5LibraryException
9279      *                - Error from the HDF-5 Library.
9280      **/
H5Tenum_valueof(long type, String name, byte[] value)9281     public synchronized static native void H5Tenum_valueof(long type, String name, byte[] value)
9282             throws HDF5LibraryException, NullPointerException;
9283 
9284     /**
9285      * H5Tenum_valueof finds the value that corresponds to the specified name of the enumeration datatype type.
9286      *
9287      * @param type
9288      *            IN: Identifier of datatype.
9289      * @param name
9290      *            IN: The name of the member
9291      * @param value
9292      *            OUT: The value of the member
9293      *
9294      * @return a non-negative value if successful
9295      *
9296      * @exception HDF5LibraryException
9297      *                - Error from the HDF-5 Library.
9298      * @exception NullPointerException
9299      *                - name is null.
9300      **/
H5Tenum_valueof(long type, String name, int[] value)9301     public static int H5Tenum_valueof(long type, String name, int[] value) throws HDF5LibraryException,
9302             NullPointerException {
9303         return H5Tenum_valueof_int(type, name, value);
9304     }
9305 
H5Tenum_valueof_int(long type, String name, int[] value)9306     private synchronized static native int H5Tenum_valueof_int(long type, String name, int[] value)
9307             throws HDF5LibraryException, NullPointerException;
9308 
9309     /**
9310      * H5Tequal determines whether two datatype identifiers refer to the same datatype.
9311      *
9312      * @param type_id1
9313      *            IN: Identifier of datatype to compare.
9314      * @param type_id2
9315      *            IN: Identifier of datatype to compare.
9316      *
9317      * @return true if the datatype identifiers refer to the same datatype, else false.
9318      *
9319      * @exception HDF5LibraryException
9320      *                - Error from the HDF-5 Library.
9321      **/
H5Tequal(long type_id1, long type_id2)9322     public synchronized static native boolean H5Tequal(long type_id1, long type_id2) throws HDF5LibraryException;
9323 
9324     /**
9325      * H5Tget_array_dims returns the sizes of the dimensions of the specified array datatype object.
9326      *
9327      * @param type_id
9328      *            IN: Datatype identifier of array object.
9329      * @param dims
9330      *            OUT: Sizes of array dimensions.
9331      *
9332      * @return the non-negative number of dimensions of the array type
9333      *
9334      * @exception HDF5LibraryException
9335      *                - Error from the HDF-5 Library.
9336      * @exception NullPointerException
9337      *                - dims is null.
9338      **/
H5Tget_array_dims(long type_id, long[] dims)9339     public static int H5Tget_array_dims(long type_id, long[] dims) throws HDF5LibraryException, NullPointerException {
9340         return H5Tget_array_dims2(type_id, dims);
9341     }
9342 
9343     /**
9344      * H5Tget_array_dims2 returns the sizes of the dimensions of the specified array datatype object.
9345      *
9346      * @param type_id
9347      *            IN: Datatype identifier of array object.
9348      * @param dims
9349      *            OUT: Sizes of array dimensions.
9350      *
9351      * @return the non-negative number of dimensions of the array type
9352      *
9353      * @exception HDF5LibraryException
9354      *                - Error from the HDF-5 Library.
9355      * @exception NullPointerException
9356      *                - dims is null.
9357      **/
H5Tget_array_dims2(long type_id, long[] dims)9358     public synchronized static native int H5Tget_array_dims2(long type_id, long[] dims) throws HDF5LibraryException,
9359             NullPointerException;
9360 
9361     /**
9362      * H5Tget_array_ndims returns the rank, the number of dimensions, of an array datatype object.
9363      *
9364      * @param type_id
9365      *            IN: Datatype identifier of array object.
9366      *
9367      * @return the rank of the array
9368      *
9369      * @exception HDF5LibraryException
9370      *                - Error from the HDF-5 Library.
9371      **/
H5Tget_array_ndims(long type_id)9372     public synchronized static native int H5Tget_array_ndims(long type_id) throws HDF5LibraryException;
9373 
9374     /**
9375      * H5Tget_class returns the datatype class identifier.
9376      *
9377      * @param type_id
9378      *            IN: Identifier of datatype to query.
9379      *
9380      * @return datatype class identifier if successful; otherwise H5T_NO_CLASS(-1).
9381      *
9382      * @exception HDF5LibraryException
9383      *                - Error from the HDF-5 Library.
9384      **/
H5Tget_class(long type_id)9385     public synchronized static native int H5Tget_class(long type_id) throws HDF5LibraryException;
9386 
9387     /**
9388      * H5Tget_class_name returns the datatype class identifier.
9389      *
9390      * @param class_id
9391      *            IN: Identifier of class from H5Tget_class.
9392      *
9393      * @return class name if successful; otherwise H5T_NO_CLASS.
9394      *
9395      **/
H5Tget_class_name(long class_id)9396     public static String H5Tget_class_name(long class_id) {
9397         String retValue = null;
9398         if (HDF5Constants.H5T_INTEGER == class_id) /* integer types */
9399             retValue = "H5T_INTEGER";
9400         else if (HDF5Constants.H5T_FLOAT == class_id) /* floating-point types */
9401             retValue = "H5T_FLOAT";
9402         else if (HDF5Constants.H5T_TIME == class_id) /* date and time types */
9403             retValue = "H5T_TIME";
9404         else if (HDF5Constants.H5T_STRING == class_id) /* character string types */
9405             retValue = "H5T_STRING";
9406         else if (HDF5Constants.H5T_BITFIELD == class_id) /* bit field types */
9407             retValue = "H5T_BITFIELD";
9408         else if (HDF5Constants.H5T_OPAQUE == class_id) /* opaque types */
9409             retValue = "H5T_OPAQUE";
9410         else if (HDF5Constants.H5T_COMPOUND == class_id) /* compound types */
9411             retValue = "H5T_COMPOUND";
9412         else if (HDF5Constants.H5T_REFERENCE == class_id)/* reference types */
9413             retValue = "H5T_REFERENCE";
9414         else if (HDF5Constants.H5T_ENUM == class_id) /* enumeration types */
9415             retValue = "H5T_ENUM";
9416         else if (HDF5Constants.H5T_VLEN == class_id) /* Variable-Length types */
9417             retValue = "H5T_VLEN";
9418         else if (HDF5Constants.H5T_ARRAY == class_id) /* Array types */
9419             retValue = "H5T_ARRAY";
9420         else
9421             retValue = "H5T_NO_CLASS";
9422 
9423         return retValue;
9424     }
9425 
9426     /**
9427      * H5Tget_create_plist returns a property list identifier for the datatype creation property list associated with
9428      * the datatype specified by type_id.
9429      *
9430      * @param type_id
9431      *            IN: Identifier of datatype.
9432      *
9433      * @return a datatype property list identifier.
9434      *
9435      * @exception HDF5LibraryException
9436      *                - Error from the HDF-5 Library.
9437      **/
H5Tget_create_plist(long type_id)9438     public static long H5Tget_create_plist(long type_id) throws HDF5LibraryException {
9439         long id = _H5Tget_create_plist(type_id);
9440         if (id > 0) {
9441             log.trace("OPEN_IDS: _H5Tget_create_plist add {}", id);
9442             OPEN_IDS.add(id);
9443             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
9444         }
9445         return id;
9446     }
9447 
_H5Tget_create_plist(long type_id)9448     private synchronized static native long _H5Tget_create_plist(long type_id) throws HDF5LibraryException;
9449 
9450     /**
9451      * H5Tget_cset retrieves the character set type of a string datatype.
9452      *
9453      * @param type_id
9454      *            IN: Identifier of datatype to query.
9455      *
9456      * @return a valid character set type if successful
9457      *
9458      * @exception HDF5LibraryException
9459      *                - Error from the HDF-5 Library.
9460      **/
H5Tget_cset(long type_id)9461     public synchronized static native int H5Tget_cset(long type_id) throws HDF5LibraryException;
9462 
9463     /**
9464      * H5Tset_cset the character set to be used.
9465      *
9466      * @param type_id
9467      *            IN: Identifier of datatype to modify.
9468      * @param cset
9469      *            IN: Character set type.
9470      *
9471      * @return a non-negative value if successful
9472      *
9473      * @exception HDF5LibraryException
9474      *                - Error from the HDF-5 Library.
9475      **/
H5Tset_cset(long type_id, int cset)9476     public synchronized static native int H5Tset_cset(long type_id, int cset) throws HDF5LibraryException;
9477 
9478     /**
9479      * H5Tget_ebias retrieves the exponent bias of a floating-point type.
9480      *
9481      * @param type_id
9482      *            Identifier of datatype to query.
9483      *
9484      * @return the bias if successful; otherwise 0.
9485      *
9486      * @exception HDF5LibraryException
9487      *                - Error from the HDF-5 Library.
9488      **/
H5Tget_ebias(long type_id)9489     public synchronized static native int H5Tget_ebias(long type_id) throws HDF5LibraryException;
9490 
9491     /**
9492      * H5Tset_ebias sets the exponent bias of a floating-point type.
9493      *
9494      * @param type_id
9495      *            Identifier of datatype to set.
9496      * @param ebias
9497      *            Exponent bias value.
9498      *
9499      * @return a non-negative value if successful
9500      *
9501      * @exception HDF5LibraryException
9502      *                - Error from the HDF-5 Library.
9503      **/
H5Tset_ebias(long type_id, int ebias)9504     public static int H5Tset_ebias(long type_id, int ebias) throws HDF5LibraryException {
9505         H5Tset_ebias(type_id, (long) ebias);
9506         return 0;
9507     }
9508 
9509     /**
9510      * H5Tget_ebias retrieves the exponent bias of a floating-point type.
9511      *
9512      * @param type_id
9513      *            IN: Identifier of datatype to query.
9514      *
9515      * @return the bias
9516      *
9517      * @exception HDF5LibraryException
9518      *                - Error from the HDF-5 Library.
9519      **/
H5Tget_ebias_long(long type_id)9520     public synchronized static native long H5Tget_ebias_long(long type_id) throws HDF5LibraryException;
9521 
9522     /**
9523      * H5Tset_ebias sets the exponent bias of a floating-point type.
9524      *
9525      * @param type_id
9526      *            IN: Identifier of datatype to set.
9527      * @param ebias
9528      *            IN: Exponent bias value.
9529      *
9530      * @exception HDF5LibraryException
9531      *                - Error from the HDF-5 Library.
9532      **/
H5Tset_ebias(long type_id, long ebias)9533     public synchronized static native void H5Tset_ebias(long type_id, long ebias) throws HDF5LibraryException;
9534 
9535     /**
9536      * H5Tget_fields retrieves information about the locations of the various bit fields of a floating point datatype.
9537      *
9538      * @param type_id
9539      *            IN: Identifier of datatype to query.
9540      * @param fields
9541      *            OUT: location of size and bit-position.
9542      *            <ul>
9543      *            <li>fields[0] = spos OUT: location to return size of in bits.</li>
9544      *            <li>fields[1] = epos OUT: location to return exponent bit-position.</li>
9545      *            <li>fields[2] = esize OUT: location to return size of exponent in bits.</li>
9546      *            <li>fields[3] = mpos OUT: location to return mantissa bit-position.</li>
9547      *            <li>fields[4] = msize OUT: location to return size of mantissa in bits.</li>
9548      *            </ul>
9549      *
9550      * @exception HDF5LibraryException
9551      *                - Error from the HDF-5 Library.
9552      * @exception NullPointerException
9553      *                - fields is null.
9554      * @exception IllegalArgumentException
9555      *                - fields array is invalid.
9556      **/
H5Tget_fields(long type_id, long[] fields)9557     public synchronized static native void H5Tget_fields(long type_id, long[] fields) throws HDF5LibraryException,
9558             NullPointerException, IllegalArgumentException;
9559 
9560     /**
9561      * H5Tget_fields retrieves information about the locations of the various bit fields of a floating point datatype.
9562      *
9563      * @param type_id
9564      *            IN: Identifier of datatype to query.
9565      * @param fields
9566      *            OUT: location of size and bit-position.
9567      *
9568      *            <pre>
9569      *      fields[0] = spos  OUT: location to return size of in bits.
9570      *      fields[1] = epos  OUT: location to return exponent bit-position.
9571      *      fields[2] = esize OUT: location to return size of exponent in bits.
9572      *      fields[3] = mpos  OUT: location to return mantissa bit-position.
9573      *      fields[4] = msize OUT: location to return size of mantissa in bits.
9574      * </pre>
9575      *
9576      * @return a non-negative value if successful
9577      *
9578      * @exception HDF5LibraryException
9579      *                - Error from the HDF-5 Library.
9580      * @exception NullPointerException
9581      *                - fields is null.
9582      * @exception IllegalArgumentException
9583      *                - fields array is invalid.
9584      **/
H5Tget_fields(long type_id, int[] fields)9585     public static int H5Tget_fields(long type_id, int[] fields) throws HDF5LibraryException, NullPointerException,
9586             IllegalArgumentException {
9587         return H5Tget_fields_int(type_id, fields);
9588     }
9589 
H5Tget_fields_int(long type_id, int[] fields)9590     private synchronized static native int H5Tget_fields_int(long type_id, int[] fields) throws HDF5LibraryException,
9591             NullPointerException, IllegalArgumentException;
9592 
9593     /**
9594      * H5Tset_fields sets the locations and sizes of the various floating point bit fields.
9595      *
9596      * @param type_id
9597      *            IN: Identifier of datatype to set.
9598      * @param spos
9599      *            IN: Size position.
9600      * @param epos
9601      *            IN: Exponent bit position.
9602      * @param esize
9603      *            IN: Size of exponent in bits.
9604      * @param mpos
9605      *            IN: Mantissa bit position.
9606      * @param msize
9607      *            IN: Size of mantissa in bits.
9608      *
9609      * @exception HDF5LibraryException
9610      *                - Error from the HDF-5 Library.
9611      **/
H5Tset_fields(long type_id, long spos, long epos, long esize, long mpos, long msize)9612     public synchronized static native void H5Tset_fields(long type_id, long spos, long epos, long esize, long mpos,
9613             long msize) throws HDF5LibraryException;
9614 
9615     /**
9616      * H5Tset_fields sets the locations and sizes of the various floating point bit fields.
9617      *
9618      * @param type_id
9619      *            Identifier of datatype to set.
9620      * @param spos
9621      *            Size position.
9622      * @param epos
9623      *            Exponent bit position.
9624      * @param esize
9625      *            Size of exponent in bits.
9626      * @param mpos
9627      *            Mantissa bit position.
9628      * @param msize
9629      *            Size of mantissa in bits.
9630      *
9631      * @return a non-negative value if successful
9632      *
9633      * @exception HDF5LibraryException
9634      *                - Error from the HDF-5 Library.
9635      **/
H5Tset_fields(long type_id, int spos, int epos, int esize, int mpos, int msize)9636     public static int H5Tset_fields(long type_id, int spos, int epos, int esize, int mpos, int msize)
9637             throws HDF5LibraryException {
9638         H5Tset_fields(type_id, (long) spos, (long) epos, (long) esize, (long) mpos, (long) msize);
9639         return 0;
9640     }
9641 
9642     /**
9643      * H5Tget_inpad retrieves the internal padding type for unused bits in floating-point datatypes.
9644      *
9645      * @param type_id
9646      *            IN: Identifier of datatype to query.
9647      *
9648      * @return a valid padding type if successful
9649      *
9650      * @exception HDF5LibraryException
9651      *                - Error from the HDF-5 Library.
9652      **/
H5Tget_inpad(long type_id)9653     public synchronized static native int H5Tget_inpad(long type_id) throws HDF5LibraryException;
9654 
9655     /**
9656      * If any internal bits of a floating point type are unused (that is, those significant bits which are not part of
9657      * the sign, exponent, or mantissa), then H5Tset_inpad will be filled according to the value of the padding value
9658      * property inpad.
9659      *
9660      * @param type_id
9661      *            IN: Identifier of datatype to modify.
9662      * @param inpad
9663      *            IN: Padding type.
9664      *
9665      * @return a non-negative value if successful
9666      *
9667      * @exception HDF5LibraryException
9668      *                - Error from the HDF-5 Library.
9669      **/
H5Tset_inpad(long type_id, int inpad)9670     public synchronized static native int H5Tset_inpad(long type_id, int inpad) throws HDF5LibraryException;
9671 
9672     /**
9673      * H5Tget_member_class returns the class of datatype of the specified member.
9674      *
9675      * @param type_id
9676      *            IN: Datatype identifier of compound object.
9677      * @param membno
9678      *            IN: Compound object member number.
9679      *
9680      * @return the class of the datatype of the field if successful;
9681      *
9682      * @exception HDF5LibraryException
9683      *                - Error from the HDF-5 Library.
9684      **/
H5Tget_member_class(long type_id, int membno)9685     public synchronized static native int H5Tget_member_class(long type_id, int membno) throws HDF5LibraryException;
9686 
9687     /**
9688      * H5Tget_member_index retrieves the index of a field of a compound datatype.
9689      *
9690      * @param type_id
9691      *            IN: Identifier of datatype to query.
9692      * @param field_name
9693      *            IN: Field name of the field index to retrieve.
9694      *
9695      * @return if field is defined, the index; else negative.
9696      **/
H5Tget_member_index(long type_id, String field_name)9697     public synchronized static native int H5Tget_member_index(long type_id, String field_name);
9698 
9699     /**
9700      * H5Tget_member_name retrieves the name of a field of a compound datatype or an element of an enumeration datatype.
9701      *
9702      * @param type_id
9703      *            IN: Identifier of datatype to query.
9704      * @param field_idx
9705      *            IN: Field index (0-based) of the field name to retrieve.
9706      *
9707      * @return a valid pointer to the name if successful; otherwise null.
9708      **/
H5Tget_member_name(long type_id, int field_idx)9709     public synchronized static native String H5Tget_member_name(long type_id, int field_idx);
9710 
9711     /**
9712      * H5Tget_member_offset returns the byte offset of the specified member of the compound datatype. This is the byte
9713      * offset in the HDF-5 file/library, NOT the offset of any Java object which might be mapped to this data item.
9714      *
9715      * @param type_id
9716      *            IN: Identifier of datatype to query.
9717      * @param membno
9718      *            IN: Field index (0-based) of the field type to retrieve.
9719      *
9720      * @return the offset of the member.
9721      *
9722      * @exception HDF5LibraryException
9723      *                - Error from the HDF-5 Library.
9724      **/
H5Tget_member_offset(long type_id, int membno)9725     public synchronized static native long H5Tget_member_offset(long type_id, int membno) throws HDF5LibraryException;
9726 
9727     /**
9728      * H5Tget_member_type returns the datatype of the specified member.
9729      *
9730      * @param type_id
9731      *            IN: Identifier of datatype to query.
9732      * @param field_idx
9733      *            IN: Field index (0-based) of the field type to retrieve.
9734      *
9735      * @return the identifier of a copy of the datatype of the field if successful;
9736      *
9737      * @exception HDF5LibraryException
9738      *                - Error from the HDF-5 Library.
9739      **/
H5Tget_member_type(long type_id, int field_idx)9740     public static long H5Tget_member_type(long type_id, int field_idx) throws HDF5LibraryException {
9741         long id = _H5Tget_member_type(type_id, field_idx);
9742         if (id > 0) {
9743             log.trace("OPEN_IDS: H5Tget_member_type add {}", id);
9744             OPEN_IDS.add(id);
9745             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
9746         }
9747         return id;
9748     }
9749 
_H5Tget_member_type(long type_id, int field_idx)9750     private synchronized static native long _H5Tget_member_type(long type_id, int field_idx)
9751             throws HDF5LibraryException;
9752 
9753     /**
9754      * H5Tget_member_value returns the value of the enumeration datatype member memb_no.
9755      *
9756      * @param type_id
9757      *            IN: Datatype identifier for the enumeration datatype.
9758      * @param membno
9759      *            IN: Number of the enumeration datatype member.
9760      * @param value
9761      *            OUT: The value of the member
9762      *
9763      * @exception HDF5LibraryException
9764      *                - Error from the HDF-5 Library.
9765      * @exception NullPointerException
9766      *                - value is null.
9767      **/
H5Tget_member_value(long type_id, int membno, byte[] value)9768     public synchronized static native void H5Tget_member_value(long type_id, int membno, byte[] value)
9769             throws HDF5LibraryException, NullPointerException;
9770 
9771     /**
9772      * H5Tget_member_value returns the value of the enumeration datatype member memb_no.
9773      *
9774      * @param type_id
9775      *            IN: Identifier of datatype.
9776      * @param membno
9777      *            IN: The name of the member
9778      * @param value
9779      *            OUT: The value of the member
9780      *
9781      * @return a non-negative value if successful
9782      *
9783      * @exception HDF5LibraryException
9784      *                - Error from the HDF-5 Library.
9785      * @exception NullPointerException
9786      *                - value is null.
9787      **/
H5Tget_member_value(long type_id, int membno, int[] value)9788     public static int H5Tget_member_value(long type_id, int membno, int[] value) throws HDF5LibraryException,
9789             NullPointerException {
9790         return H5Tget_member_value_int(type_id, membno, value);
9791     }
9792 
H5Tget_member_value_int(long type_id, int membno, int[] value)9793     private synchronized static native int H5Tget_member_value_int(long type_id, int membno, int[] value)
9794             throws HDF5LibraryException, NullPointerException;
9795 
9796     /**
9797      * H5Tget_native_type returns the equivalent native datatype for the datatype specified in type_id.
9798      *
9799      * @param type_id
9800      *            IN: Identifier of datatype to query. Direction of search is assumed to be in ascending order.
9801      *
9802      * @return the native datatype identifier for the specified dataset datatype.
9803      *
9804      * @exception HDF5LibraryException
9805      *                - Error from the HDF-5 Library.
9806      **/
H5Tget_native_type(long type_id)9807     public synchronized static long H5Tget_native_type(long type_id) throws HDF5LibraryException {
9808         return H5Tget_native_type(type_id, HDF5Constants.H5T_DIR_ASCEND);
9809     }
9810 
9811     /**
9812      * H5Tget_native_type returns the equivalent native datatype for the datatype specified in type_id.
9813      *
9814      * @param type_id
9815      *            IN: Identifier of datatype to query.
9816      * @param direction
9817      *            IN: Direction of search.
9818      *
9819      * @return the native datatype identifier for the specified dataset datatype.
9820      *
9821      * @exception HDF5LibraryException
9822      *                - Error from the HDF-5 Library.
9823      **/
H5Tget_native_type(long type_id, int direction)9824     public static long H5Tget_native_type(long type_id, int direction) throws HDF5LibraryException {
9825         long id = _H5Tget_native_type(type_id, direction);
9826         if (id > 0) {
9827             log.trace("OPEN_IDS: H5Tget_native_type add {}", id);
9828             OPEN_IDS.add(id);
9829             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
9830         }
9831         return id;
9832     }
9833 
_H5Tget_native_type(long tid, int direction)9834     private synchronized static native long _H5Tget_native_type(long tid, int direction) throws HDF5LibraryException;
9835 
9836     /**
9837      * H5Tget_nmembers retrieves the number of fields a compound datatype has.
9838      *
9839      * @param type_id
9840      *            IN: Identifier of datatype to query.
9841      *
9842      * @return number of members datatype has if successful
9843      *
9844      * @exception HDF5LibraryException
9845      *                - Error from the HDF-5 Library.
9846      **/
H5Tget_nmembers(long type_id)9847     public synchronized static native int H5Tget_nmembers(long type_id) throws HDF5LibraryException;
9848 
9849     /**
9850      * H5Tget_norm retrieves the mantissa normalization of a floating-point datatype.
9851      *
9852      * @param type_id
9853      *            IN: Identifier of datatype to query.
9854      *
9855      * @return a valid normalization type if successful
9856      *
9857      * @exception HDF5LibraryException
9858      *                - Error from the HDF-5 Library.
9859      **/
H5Tget_norm(long type_id)9860     public synchronized static native int H5Tget_norm(long type_id) throws HDF5LibraryException;
9861 
9862     /**
9863      * H5Tset_norm sets the mantissa normalization of a floating-point datatype.
9864      *
9865      * @param type_id
9866      *            IN: Identifier of datatype to set.
9867      * @param norm
9868      *            IN: Mantissa normalization type.
9869      *
9870      * @return a non-negative value if successful
9871      *
9872      * @exception HDF5LibraryException
9873      *                - Error from the HDF-5 Library.
9874      **/
H5Tset_norm(long type_id, int norm)9875     public synchronized static native int H5Tset_norm(long type_id, int norm) throws HDF5LibraryException;
9876 
9877     /**
9878      * H5Tget_offset retrieves the bit offset of the first significant bit.
9879      *
9880      * @param type_id
9881      *            IN: Identifier of datatype to query.
9882      *
9883      * @return a positive offset value if successful; otherwise 0.
9884      *
9885      * @exception HDF5LibraryException
9886      *                - Error from the HDF-5 Library.
9887      **/
H5Tget_offset(long type_id)9888     public synchronized static native int H5Tget_offset(long type_id) throws HDF5LibraryException;
9889 
9890     /**
9891      * H5Tset_offset sets the bit offset of the first significant bit.
9892      *
9893      * @param type_id
9894      *            Identifier of datatype to set.
9895      * @param offset
9896      *            Offset of first significant bit.
9897      *
9898      * @return a non-negative value if successful
9899      *
9900      * @exception HDF5LibraryException
9901      *                - Error from the HDF-5 Library.
9902      **/
H5Tset_offset(long type_id, int offset)9903     public static int H5Tset_offset(long type_id, int offset) throws HDF5LibraryException {
9904         H5Tset_offset(type_id, (long) offset);
9905         return 0;
9906     }
9907 
9908     /**
9909      * H5Tset_offset sets the bit offset of the first significant bit.
9910      *
9911      * @param type_id
9912      *            IN: Identifier of datatype to set.
9913      * @param offset
9914      *            IN: Offset of first significant bit.
9915      *
9916      * @exception HDF5LibraryException
9917      *                - Error from the HDF-5 Library.
9918      **/
H5Tset_offset(long type_id, long offset)9919     public synchronized static native void H5Tset_offset(long type_id, long offset) throws HDF5LibraryException;
9920 
9921     /**
9922      * H5Tget_order returns the byte order of an atomic datatype.
9923      *
9924      * @param type_id
9925      *            IN: Identifier of datatype to query.
9926      *
9927      * @return a byte order constant if successful
9928      *
9929      * @exception HDF5LibraryException
9930      *                - Error from the HDF-5 Library.
9931      **/
H5Tget_order(long type_id)9932     public synchronized static native int H5Tget_order(long type_id) throws HDF5LibraryException;
9933 
9934     /**
9935      * H5Tset_order sets the byte ordering of an atomic datatype.
9936      *
9937      * @param type_id
9938      *            IN: Identifier of datatype to set.
9939      * @param order
9940      *            IN: Byte ordering constant.
9941      *
9942      * @return a non-negative value if successful
9943      *
9944      * @exception HDF5LibraryException
9945      *                - Error from the HDF-5 Library.
9946      **/
H5Tset_order(long type_id, int order)9947     public synchronized static native int H5Tset_order(long type_id, int order) throws HDF5LibraryException;
9948 
9949     /**
9950      * H5Tget_pad retrieves the padding type of the least and most-significant bit padding.
9951      *
9952      * @param type_id
9953      *            IN: Identifier of datatype to query.
9954      * @param pad
9955      *            OUT: locations to return least-significant and most-significant bit padding type.
9956      *
9957      *            <pre>
9958      *      pad[0] = lsb // least-significant bit padding type
9959      *      pad[1] = msb // most-significant bit padding type
9960      * </pre>
9961      *
9962      * @return a non-negative value if successful
9963      *
9964      * @exception HDF5LibraryException
9965      *                - Error from the HDF-5 Library.
9966      * @exception NullPointerException
9967      *                - pad is null.
9968      **/
H5Tget_pad(long type_id, int[] pad)9969     public synchronized static native int H5Tget_pad(long type_id, int[] pad) throws HDF5LibraryException,
9970             NullPointerException;
9971 
9972     /**
9973      * H5Tset_pad sets the least and most-significant bits padding types.
9974      *
9975      * @param type_id
9976      *            IN: Identifier of datatype to set.
9977      * @param lsb
9978      *            IN: Padding type for least-significant bits.
9979      * @param msb
9980      *            IN: Padding type for most-significant bits.
9981      *
9982      * @return a non-negative value if successful
9983      *
9984      * @exception HDF5LibraryException
9985      *                - Error from the HDF-5 Library.
9986      **/
H5Tset_pad(long type_id, int lsb, int msb)9987     public synchronized static native int H5Tset_pad(long type_id, int lsb, int msb) throws HDF5LibraryException;
9988 
9989     /**
9990      * H5Tget_precision returns the precision of an atomic datatype.
9991      *
9992      * @param type_id
9993      *            Identifier of datatype to query.
9994      *
9995      * @return the number of significant bits if successful
9996      *
9997      * @exception HDF5LibraryException
9998      *                - Error from the HDF-5 Library.
9999      **/
H5Tget_precision(long type_id)10000     public synchronized static native int H5Tget_precision(long type_id) throws HDF5LibraryException;
10001 
10002     /**
10003      * H5Tset_precision sets the precision of an atomic datatype.
10004      *
10005      * @param type_id
10006      *            Identifier of datatype to set.
10007      * @param precision
10008      *            Number of bits of precision for datatype.
10009      *
10010      * @return a non-negative value if successful
10011      *
10012      * @exception HDF5LibraryException
10013      *                - Error from the HDF-5 Library.
10014      **/
H5Tset_precision(long type_id, int precision)10015     public static int H5Tset_precision(long type_id, int precision) throws HDF5LibraryException {
10016         H5Tset_precision(type_id, (long) precision);
10017         return 0;
10018     }
10019 
10020     /**
10021      * H5Tget_precision returns the precision of an atomic datatype.
10022      *
10023      * @param type_id
10024      *            IN: Identifier of datatype to query.
10025      *
10026      * @return the number of significant bits if successful
10027      *
10028      * @exception HDF5LibraryException
10029      *                - Error from the HDF-5 Library.
10030      **/
H5Tget_precision_long(long type_id)10031     public synchronized static native long H5Tget_precision_long(long type_id) throws HDF5LibraryException;
10032 
10033     /**
10034      * H5Tset_precision sets the precision of an atomic datatype.
10035      *
10036      * @param type_id
10037      *            IN: Identifier of datatype to set.
10038      * @param precision
10039      *            IN: Number of bits of precision for datatype.
10040      *
10041      * @exception HDF5LibraryException
10042      *                - Error from the HDF-5 Library.
10043      **/
H5Tset_precision(long type_id, long precision)10044     public synchronized static native void H5Tset_precision(long type_id, long precision) throws HDF5LibraryException;
10045 
10046     /**
10047      * H5Tget_sign retrieves the sign type for an integer type.
10048      *
10049      * @param type_id
10050      *            IN: Identifier of datatype to query.
10051      *
10052      * @return a valid sign type if successful
10053      *
10054      * @exception HDF5LibraryException
10055      *                - Error from the HDF-5 Library.
10056      **/
H5Tget_sign(long type_id)10057     public synchronized static native int H5Tget_sign(long type_id) throws HDF5LibraryException;
10058 
10059     /**
10060      * H5Tset_sign sets the sign proprety for an integer type.
10061      *
10062      * @param type_id
10063      *            IN: Identifier of datatype to set.
10064      * @param sign
10065      *            IN: Sign type.
10066      *
10067      * @return a non-negative value if successful
10068      *
10069      * @exception HDF5LibraryException
10070      *                - Error from the HDF-5 Library.
10071      **/
H5Tset_sign(long type_id, int sign)10072     public synchronized static native int H5Tset_sign(long type_id, int sign) throws HDF5LibraryException;
10073 
10074     /**
10075      * H5Tget_size returns the size of a datatype in bytes.
10076      *
10077      * @param type_id
10078      *            IN: Identifier of datatype to query.
10079      *
10080      * @return the size of the datatype in bytes
10081      *
10082      * @exception HDF5LibraryException
10083      *                - Error from the HDF-5 Library.
10084      **/
H5Tget_size(long type_id)10085     public synchronized static native long H5Tget_size(long type_id) throws HDF5LibraryException;
10086 
10087     /**
10088      * H5Tset_size sets the total size in bytes, size, for an atomic datatype (this operation is not permitted on
10089      * compound datatypes).
10090      *
10091      * @param type_id
10092      *            IN: Identifier of datatype to change size.
10093      * @param size
10094      *            IN: Size in bytes to modify datatype.
10095      *
10096      * @return a non-negative value if successful
10097      *
10098      * @exception HDF5LibraryException
10099      *                - Error from the HDF-5 Library.
10100      **/
H5Tset_size(long type_id, long size)10101     public synchronized static native int H5Tset_size(long type_id, long size) throws HDF5LibraryException;
10102 
10103     /**
10104      * H5Tget_strpad retrieves the string padding method for a string datatype.
10105      *
10106      * @param type_id
10107      *            IN: Identifier of datatype to query.
10108      *
10109      * @return a valid string padding type if successful
10110      *
10111      * @exception HDF5LibraryException
10112      *                - Error from the HDF-5 Library.
10113      **/
H5Tget_strpad(long type_id)10114     public synchronized static native int H5Tget_strpad(long type_id) throws HDF5LibraryException;
10115 
10116     /**
10117      * H5Tset_strpad defines the storage mechanism for the string.
10118      *
10119      * @param type_id
10120      *            IN: Identifier of datatype to modify.
10121      * @param strpad
10122      *            IN: String padding type.
10123      *
10124      * @return a non-negative value if successful
10125      *
10126      * @exception HDF5LibraryException
10127      *                - Error from the HDF-5 Library.
10128      **/
H5Tset_strpad(long type_id, int strpad)10129     public synchronized static native int H5Tset_strpad(long type_id, int strpad) throws HDF5LibraryException;
10130 
10131     /**
10132      * H5Tget_super returns the type from which TYPE is derived.
10133      *
10134      * @param type
10135      *            IN: Identifier of datatype.
10136      *
10137      * @return the parent type
10138      *
10139      * @exception HDF5LibraryException
10140      *                - Error from the HDF-5 Library.
10141      **/
H5Tget_super(long type)10142     public static long H5Tget_super(long type) throws HDF5LibraryException {
10143         long id = _H5Tget_super(type);
10144         if (id > 0) {
10145             log.trace("OPEN_IDS: H5Tget_super add {}", id);
10146             OPEN_IDS.add(id);
10147             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
10148         }
10149         return id;
10150     }
10151 
_H5Tget_super(long type)10152     private synchronized static native long _H5Tget_super(long type) throws HDF5LibraryException;
10153 
10154     /**
10155      * H5Tget_tag returns the tag associated with datatype type_id.
10156      *
10157      * @param type
10158      *            IN: Identifier of datatype.
10159      *
10160      * @return the tag
10161      *
10162      * @exception HDF5LibraryException
10163      *                - Error from the HDF-5 Library.
10164      **/
H5Tget_tag(long type)10165     public synchronized static native String H5Tget_tag(long type) throws HDF5LibraryException;
10166 
10167     /**
10168      * H5Tset_tag tags an opaque datatype type_id with a unique ASCII identifier tag.
10169      *
10170      * @param type
10171      *            IN: Datatype identifier for the opaque datatype to be tagged.
10172      * @param tag
10173      *            IN: Descriptive ASCII string with which the opaque datatype is to be tagged.
10174      *
10175      * @return a non-negative value if successful
10176      *
10177      * @exception HDF5LibraryException
10178      *                - Error from the HDF-5 Library.
10179      **/
H5Tset_tag(long type, String tag)10180     public synchronized static native int H5Tset_tag(long type, String tag) throws HDF5LibraryException;
10181 
10182     /**
10183      * H5Tinsert adds another member to the compound datatype type_id.
10184      *
10185      * @param type_id
10186      *            IN: Identifier of compound datatype to modify.
10187      * @param name
10188      *            IN: Name of the field to insert.
10189      * @param offset
10190      *            IN: Offset in memory structure of the field to insert.
10191      * @param field_id
10192      *            IN: Datatype identifier of the field to insert.
10193      *
10194      * @return a non-negative value if successful
10195      *
10196      * @exception HDF5LibraryException
10197      *                - Error from the HDF-5 Library.
10198      * @exception NullPointerException
10199      *                - name is null.
10200      **/
H5Tinsert(long type_id, String name, long offset, long field_id)10201     public synchronized static native int H5Tinsert(long type_id, String name, long offset, long field_id)
10202             throws HDF5LibraryException, NullPointerException;
10203 
10204     /**
10205      * H5Tis_variable_str determines whether the datatype identified in type_id is a variable-length string.
10206      *
10207      * @param type_id
10208      *            IN: Identifier of datatype to query.
10209      *
10210      * @return true if type_id is a variable-length string.
10211      *
10212      * @exception HDF5LibraryException
10213      *                - Error from the HDF-5 Library.
10214      **/
H5Tis_variable_str(long type_id)10215     public synchronized static native boolean H5Tis_variable_str(long type_id) throws HDF5LibraryException;
10216 
10217     /**
10218      * H5Tlock locks the datatype specified by the type_id identifier, making it read-only and non-destrucible.
10219      *
10220      * @param type_id
10221      *            IN: Identifier of datatype to lock.
10222      *
10223      * @return a non-negative value if successful
10224      *
10225      * @exception HDF5LibraryException
10226      *                - Error from the HDF-5 Library.
10227      **/
H5Tlock(long type_id)10228     public synchronized static native int H5Tlock(long type_id) throws HDF5LibraryException;
10229 
10230     /**
10231      * H5Topen opens a named datatype at the location specified by loc_id and return an identifier for the datatype.
10232      *
10233      * @param loc_id
10234      *            IN: A file, group, or datatype identifier.
10235      * @param name
10236      *            IN: A datatype name, defined within the file or group identified by loc_id.
10237      * @param tapl_id
10238      *            IN: Datatype access property list.
10239      *
10240      * @return a named datatype identifier if successful
10241      *
10242      * @exception HDF5LibraryException
10243      *                - Error from the HDF-5 Library.
10244      * @exception NullPointerException
10245      *                - name is null.
10246      **/
H5Topen(long loc_id, String name, long tapl_id)10247     public static long H5Topen(long loc_id, String name, long tapl_id) throws HDF5LibraryException,
10248     NullPointerException {
10249         long id = _H5Topen2(loc_id, name, tapl_id);
10250         if (id > 0) {
10251             log.trace("OPEN_IDS: H5Topen add {}", id);
10252             OPEN_IDS.add(id);
10253             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
10254         }
10255         return id;
10256     }
10257 
_H5Topen2(long loc_id, String name, long tapl_id)10258     private synchronized static native long _H5Topen2(long loc_id, String name, long tapl_id)
10259             throws HDF5LibraryException, NullPointerException;
10260 
10261     /**
10262      * H5Tpack recursively removes padding from within a compound datatype to make it more efficient (space-wise) to
10263      * store that data.
10264      * <P>
10265      * <b>WARNING:</b> This call only affects the C-data, even if it succeeds, there may be no visible effect on Java
10266      * objects.
10267      *
10268      * @param type_id
10269      *            IN: Identifier of datatype to modify.
10270      *
10271      * @return a non-negative value if successful
10272      *
10273      * @exception HDF5LibraryException
10274      *                - Error from the HDF-5 Library.
10275      **/
H5Tpack(long type_id)10276     public synchronized static native int H5Tpack(long type_id) throws HDF5LibraryException;
10277 
10278     /**
10279      * H5Tvlen_create creates a new variable-length (VL) dataype.
10280      *
10281      * @param base_id
10282      *            IN: Identifier of parent datatype.
10283      *
10284      * @return a non-negative value if successful
10285      *
10286      * @exception HDF5LibraryException
10287      *                - Error from the HDF-5 Library.
10288      **/
H5Tvlen_create(long base_id)10289     public static long H5Tvlen_create(long base_id) throws HDF5LibraryException {
10290         long id = _H5Tvlen_create(base_id);
10291         if (id > 0) {
10292             log.trace("OPEN_IDS: H5Tvlen_create add {}", id);
10293             OPEN_IDS.add(id);
10294             log.trace("OPEN_IDS: {}", OPEN_IDS.size());
10295         }
10296         return id;
10297     }
10298 
_H5Tvlen_create(long base_id)10299     private synchronized static native long _H5Tvlen_create(long base_id) throws HDF5LibraryException;
10300 
10301     /**
10302      * H5Tflush causes all buffers associated with a committed datatype to be immediately flushed to disk
10303      * without removing the data from the cache.
10304      *
10305      * @param dtype_id
10306      *            IN: Identifier of the committed datatype to be flushed.
10307      *
10308      * @exception HDF5LibraryException
10309      *                - Error from the HDF-5 Library.
10310      **/
H5Tflush(long dtype_id)10311     public synchronized static native void H5Tflush(long dtype_id) throws HDF5LibraryException;
10312 
10313     /**
10314      * H5Trefresh causes all buffers associated with a committed datatype to be cleared and immediately
10315      * re-loaded with updated contents from disk. This function essentially closes the datatype, evicts
10316      * all metadata associated with it from the cache, and then re-opens the datatype. The reopened datatype
10317      * is automatically re-registered with the same ID.
10318      *
10319      * @param dtype_id
10320      *            IN: Identifier of the committed datatype to be refreshed.
10321      *
10322      * @exception HDF5LibraryException
10323      *                - Error from the HDF-5 Library.
10324      **/
H5Trefresh(long dtype_id)10325     public synchronized static native void H5Trefresh(long dtype_id) throws HDF5LibraryException;
10326 
10327     // /////// unimplemented ////////
10328 
10329     // H5T_conv_t H5Tfind(int src_id, int dst_id, H5T_cdata_t *pcdata);
10330 
10331     // public synchronized static native int H5Tregister(H5T_pers_t pers, String name, int src_id, int dst_id,
10332     // H5T_conv_t func)
10333     // throws HDF5LibraryException, NullPointerException;
10334 
10335     // public synchronized static native int H5Tunregister(H5T_pers_t pers, String name, int src_id, int dst_id,
10336     // H5T_conv_t func)
10337     // throws HDF5LibraryException, NullPointerException;
10338 
10339     // ////////////////////////////////////////////////////////////
10340     // //
10341     // H5Z: Filter Interface Functions //
10342     // //
10343     // ////////////////////////////////////////////////////////////
10344 
H5Zfilter_avail(int filter)10345     public synchronized static native int H5Zfilter_avail(int filter) throws HDF5LibraryException, NullPointerException;
10346 
H5Zget_filter_info(int filter)10347     public synchronized static native int H5Zget_filter_info(int filter) throws HDF5LibraryException;
10348 
H5Zunregister(int filter)10349     public synchronized static native int H5Zunregister(int filter) throws HDF5LibraryException, NullPointerException;
10350 
10351     // /////// unimplemented ////////
10352 
10353     // herr_t H5Zregister(const void *cls);
10354 
10355 }
10356 
10357