Page tree

The license could not be verified: License Certificate has expired!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

JHI5 Design Notes

Important Changes

Very Important Change: Version 3.0 (and above) of the JHI5 packages all HDF library
calls as "hdf.hd5flib", note that the "ncsa" has been removed.
Source code which used earlier versions of the JHI5 should be changed to
reflect this new implementation.

What it is

The Java HD5 Interface (JHI5) is a Java package (hdf.hdf5lib) that ``wraps around'' the HDF5 library.

There are over 460 functions in the HDF5 library (version 1.8). Ninety three of the functions are not supported in JHI5. Most of the unsupported functions have C function pointers, which is not currently implemented in JHI5. For a complete list of unsupported functions, please see unsupported functions.

Note: The JHI5 does not support HDF4 or earlier.  See the JHI.

The JHI5 may be used by any Java application that needs to access HDF5 files. It is extremely important to emphasize that this package is not a pure Java implementation of the HDF-5 library. The JHI5 calls the same HDF5 library that is used by C or FORTRAN programs. (Note that this product cannot be used in most network browsers because it accesses the local disk using native code.)

The Java HDF5 Interface consists of Java classes and a dynamically linked native library. The Java classes declare native methods, and the library contains C functions which implement the native methods. The C functions call the standard HDF5 library, which is linked as part of the same library on most platforms.

The central part of the JHI5 is the Java class hdf.hdf5lib.H5. The H5 class calls the standard (i.e., `native' code) HDF5 library, with native methods for most of the HDF5 functions.

How to use it

The JHI5 is used by Java classes to call the HDF5 library, in order to create HDF5 files, and read and write data in existing HDF5 files.

For example, the HDF5 library has the function H5Fopen to open an HDF5 file. The Java interface is the class hdf.hdf5lib.H5, which has a method:

static native int H5Fopen(String filename, int flags, int access );

The native method is implemented in C using the Java Native Method Interface (JNI). This is written something like the following:

JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Fopen ( JNIEnv *env, jclass class, jstring hdfFile, jint flags, jint access)  {  /* ...convert Java String to (char *) */  /* call the HDF library */  retVal = H5Fopen((char *)file, (unsigned)flags, (hid_t)access );  /* ... */ }

This C function calls the HDF5 library and returns the result appropriately.

There is one native method for each HDF entry point (several hundred in all), which are compiled with the HDF library into a dynamically loaded library (libjhdf5). Note that this library must be built for each platform.

To call the HDF `H5Fopen' function, a Java program would import the package 'hdf.hdf5lib.*', and invoke the method on the class 'H5'. The Java program would look something like this:

import hdf.hdf5lib.*; {  /* ... */  try {  file = H5.Hopen("myFile.hdf", flags, access );  } catch (HDF5Exception ex) {  //...  }  /* ... */ }

The H5 class automatically loads the native method implementations and the HDF-5 library.

 

Unsupported Functions

H5DdebugLow priority
H5DgatherFunction pointer
H5DscatterFunction pointer
H5Eget_auto1Function pointer
H5Eget_auto2Function pointer
H5Epush1Function format with list
H5Epush2Function format with list
H5Eset_auto1Function pointer
H5Eset_auto2Function pointer
H5FDallocFunction pointer
H5FDcloseFunction pointer
H5FDcmpFunction pointer
H5FDflushFunction pointer
H5FDfreeFunction pointer
H5FDget_eoaFunction pointer
H5FDget_eofFunction pointer
H5FDget_vfd_handleFunction pointer
H5FDqueryFunction pointer
H5FDreadFunction pointer
H5FDregisterFunction pointer
H5FDset_eoaFunction pointer
H5FDtruncateFunction pointer
H5FDunregisterFunction pointer
H5FDwriteFunction pointer
H5Fget_file_imageFunction pointer
H5Fget_mdc_configFunction pointer
H5Fget_vfd_handleFunction pointer
H5Fset_mdc_configFunction pointer
H5GiterateFunction pointer
H5IregisterFunction pointer
H5Iregister_typeFunction pointer
H5Iobject_verifyFunction pointer
H5Iremove_verifyFunction pointer
H5IsearchFunction pointer
H5Lcreate_udFunction pointer
H5LregisterFunction pointer
H5Lunpack_elink_valFunction pointer
H5Pcreate_classFunction pointer
H5Pget_elink_cbFunction pointer
H5Pget_multi_typeLow priority
H5Pget_type_conv_cbFunction pointer
H5Pget_vlen_mem_managerFunction pointer
H5Pinsert1Function pointer
H5Pinsert2Function pointer
H5PiterateFunction pointer
H5Pregister1Function pointer
H5Pregister2Function pointer
H5Pset_driverFunction pointer
H5Pset_dxpl_mpio_chunk_optFunction pointer
H5Pset_dxpl_mpio_chunk_opt_numFunction pointer
H5Pset_dxpl_mpio_chunk_opt_ratioFunction pointer
H5Pset_dxpl_mpio_collective_optFunction pointer
H5Pset_elink_cbFunction pointer
H5Pset_filter_callbackFunction pointer
H5Pset_multi_typeLow priority
H5Pset_type_conv_cbFunction pointer
H5Pset_vlen_mem_managerFunction pointer
H5TfindFunction pointer
H5TregisterFunction pointer
H5TunregisterFunction pointer
H5ZregisterFunction pointer

--- Last Modified: September 01, 2017 | 01:09 PM