Class HDFLibrary
- java.lang.Object
-
- hdf.hdflib.HDFLibrary
-
- All Implemented Interfaces:
java.io.Serializable
public class HDFLibrary extends java.lang.Object implements java.io.SerializableThis is the Java interface for the HDF 4.2 library.This code is the called by Java programs to access the entry points of the HDF 4.2 library. Each routine wraps a single HDF entry point, generally with the arguments and return codes analogous to the C interface.
These routines use the class HDFArray to handle arrays of arbitrary type and shape.
Mapping of arguments for Java
In general, arguments to the HDF Java API are straightforward translations from the 'C' API described in the HDF Reference Manual.
General Rules for Passing Arguments and ResultsC types to Java types C Java int, intn, int32, uint32 int short, uint16, int16 short float, float32 float double, float64 double char, uchar, int8, uint8 byte char * (i.e., string) java.lang.String void void void *, void *, char * (meaning ``any'') Special -- see HDFArray In general, arguments passed IN to Java are the analogous basic types, as above. The exception is for arrays, which are discussed below.
The return value of Java methods is also the analogous type, as above. A major exception to that rule is that all HDF functions that return SUCCEED/FAIL are declared boolean in the Java version, rather than intn or whatever. (Functions that return a value or else FAIL are declared the equivalent to the C function.)
Java does not support pass by reference of arguments, so arguments that are returned through OUT parameters must be wrapped in an object or array. The Java API for HDF consistently wraps arguments in arrays.
For instance, a function that returns two integers is declared:
void HDFdummy( int32* a1, int32* a2)For the Java interface, this would be declared:public static native void HDFdummy(int args[]);
where a1 is args[0] and a2 is args[1].All the routines where this convention is used will have specific documentation of the details, given below.
Arrays
HDF needs to read and write multi-dimensional arrays of many types. The HDF API is self-describing, with the data for the array passed as a block of bytes, for instance,
int SDreaddata(int sdsid, int32 *start, int32 * stride, int32 *count, void * data);The data parameter may be any valid numeric type, and is a contiguous block of bytes that is the data for a multi-dimensional array.
For Java, this is a problem, as the type of data must be declared. Furthermore, multidimensional arrays are definitely not laid out contiguously in memory. It would be infeasible to declare a separate routine for every combination of number type and dimensionality. For that reason, the HDFArray class is used to discover the type, shape, and size of the data array at run time, and to convert to and from contiguous bytes. The upshot is that the data can be passed as an ``Object'', and the Java API will translate to and from the appropriate bytes. So the function above would be declared:
int SDreaddata(int sdsid, int[] start, int[] stride, int[] count, Object data);
and the parameter data can be any multi-dimensional array of numbers, such as float[][], or int[][][]. Compression and Chunk InformationThe HDF library passes the parameters needed by compression and chunking through C structures (actually, unions). The Java interface passes these as instances of subclasses of class HDFCompInfo and HDFChunkInfo respectively.
See: hdf.hdflib.HDFChunkInfo, and
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringH4_LIBRARY_NAME_PROPERTY_KEYstatic java.lang.StringHDFPATH_PROPERTY_KEY
-
Constructor Summary
Constructors Constructor Description HDFLibrary()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static intANannlen(long ann_id)static intANannlist(long an_id, int anntype, short tag, short ref, int[] ann_list)static shortANatype2tag(int antag)static intANcreate(long an_id, short tag, short ref, int type)static intANcreatef(long an_id, int type)static booleanANend(long an_id)static booleanANendaccess(long an_id)static booleanANfileinfo(long an_id, int[] info)static intANget_tagref(long an_id, int index, int type, short[] tagref)static booleanANid2tagref(long an_id, short[] tagref)static intANnumann(long an_id, int anntype, short tag, short ref)static booleanANreadann(long ann_id, java.lang.String[] annbuf, int maxlen)static intANselect(long an_id, int index, int anntype)static intANstart(long fid)static intANtag2atype(short anttype)static longANtagref2id(long an_id, short tag, short ref)static booleanANwriteann(long ann_id, java.lang.String label, int ann_length)static booleanDF24addimage(java.lang.String filename, byte[] image, int width, int height)static booleanDF24addimage(java.lang.String filename, java.lang.Object theImage, int width, int height)static booleanDF24getdims(java.lang.String fileName, int[] argv)static booleanDF24getimage(java.lang.String fileName, byte[] imagedata, int width, int height)static booleanDF24getimage(java.lang.String fileName, java.lang.Object theImagedata, int width, int height)static shortDF24lastref()static intDF24nimages(java.lang.String fileName)static booleanDF24putimage(java.lang.String filename, byte[] image, int width, int height)static booleanDF24putimage(java.lang.String filename, java.lang.Object theImage, int width, int height)static booleanDF24readref(java.lang.String filename, int ref)static booleanDF24reqil(int il)static booleanDF24restart()static booleanDF24setcompress(int type, HDFCompInfo cinfo)static booleanDF24setdims(int width, int height)static booleanDF24setil(int il)static intDFKNTsize(long numbertype)static booleanDFPaddpal(java.lang.String filename, byte[] palette)static booleanDFPgetpal(java.lang.String filename, byte[] palette)static shortDFPlastref()static intDFPnpals(java.lang.String filename)static booleanDFPputpal(java.lang.String filename, byte[] palette, boolean overwrite, java.lang.String filemode)static booleanDFPputpal(java.lang.String filename, byte[] palette, int overwrite, java.lang.String filemode)static booleanDFPreadref(java.lang.String filename, short ref)static shortDFPrestart()static booleanDFPwriteref(java.lang.String filename, short ref)static booleanDFR8addimage(java.lang.String filename, byte[] image, int width, int height, short compress)static booleanDFR8addimage(java.lang.String filename, java.lang.Object theImage, int width, int height, short compress)static booleanDFR8getdims(java.lang.String fileName, int[] argv, boolean[] haspalette)static booleanDFR8getimage(java.lang.String fileName, byte[] imagedata, int width, int height, byte[] palette)static booleanDFR8getimage(java.lang.String fileName, java.lang.Object theImagedata, int width, int height, byte[] palette)static booleanDFR8getpalref(short[] palref)static shortDFR8lastref()static intDFR8nimages(java.lang.String fileName)static booleanDFR8putimage(java.lang.String filename, byte[] image, int width, int height, short compress)static booleanDFR8putimage(java.lang.String filename, java.lang.Object theImage, int width, int height, short compress)static booleanDFR8readref(java.lang.String filename, int ref)static booleanDFR8restart()static booleanDFR8setcompress(int type, HDFCompInfo cinfo)DFR8setcompress sets compression scheme for 8-bit imagestatic booleanDFR8setpalette(byte[] palette)static booleanDFR8writeref(java.lang.String filename, short ref)static java.lang.StringgetJHIVersion()Deprecated.static booleanGRattrinfo(long id, int index, java.lang.String[] name, int[] argv)static intGRcreate(long gr_id, java.lang.String name, int ncomp, long data_type, int interlace_mode, int[] dim_sizes)static booleanGRend(long grid)static booleanGRendaccess(long riid)static booleanGRfileinfo(long grid, int[] args)static intGRfindattr(long id, java.lang.String name)static booleanGRgetattr(long id, int index, byte[] data)static booleanGRgetattr(long id, int index, java.lang.Object theData)static booleanGRgetchunkinfo(long sdsid, HDFChunkInfo chunk_def, int[] flag)static booleanGRgetcompinfo(long ri_id, HDFCompInfo c_info)static booleanGRgetcompress(long ri_id, HDFCompInfo c_info)static booleanGRgetiminfo(long grid, java.lang.String[] gr_name, int[] args, int[] dim_sizes)static intGRgetlutid(long rrid, int index)static booleanGRgetlutinfo(long lutid, int[] args)static intGRgetnluts(long rrid)static shortGRidtoref(long riid)static shortGRluttoref(long pal_id)static intGRnametoindex(long grid, java.lang.String name)static booleanGRreadchunk(long sdsid, int[] origin, byte[] theData)static booleanGRreadchunk(long grid, int[] origin, java.lang.Object theData)static booleanGRreadimage(long grid, int[] start, int[] stride, int[] count, byte[] data)static booleanGRreadimage(long grid, int[] start, int[] stride, int[] count, java.lang.Object theData)static booleanGRreadlut(long lutid, byte[] data)static booleanGRreadlut(long lutid, java.lang.Object theData)static intGRreftoindex(long grid, short ref)static booleanGRreqimageil(long rrid, int interlace)static booleanGRreqlutil(long riid, int interlace)static intGRselect(long grid, int index)static booleanGRsetattr(long gr_id, java.lang.String attr_name, long data_type, int count, byte[] values)static booleanGRsetattr(long gr_id, java.lang.String attr_name, long data_type, int count, java.lang.Object theData)static booleanGRsetattr(long gr_id, java.lang.String attr_name, long data_type, int count, java.lang.String values)static booleanGRsetchunk(long sdsid, HDFChunkInfo chunk_def, int flags)static intGRsetchunkcache(long sdsid, int maxcache, int flags)static booleanGRsetcompress(long ri_id, int comp_type, HDFCompInfo c_info)static booleanGRsetexternalfile(long ri_id, java.lang.String filename, int offset)static intGRstart(long fid)static booleanGRwriteimage(long grid, int[] start, int[] stride, int[] edge, byte[] data)static booleanGRwriteimage(long grid, int[] start, int[] stride, int[] edge, java.lang.Object theData)static booleanGRwritelut(long pal_id, int ncomp, int data_type, int interlace, int num_entries, byte[] pal_data)static booleanGRwritelut(long pal_id, int ncomp, int data_type, int interlace, int num_entries, java.lang.Object theData)static booleanHcache(long file_id, int cache_switch)static intHCget_config_info(int coder_type)New API for hdf-42r1static booleanHclose(long fid)static intHDdont_atexit()static booleanHDFclose(long file_id)static longHDFopen(java.lang.String filename, int access, short n_dds)static java.lang.StringHDgetNTdesc(int nt)static voidHEprint(java.lang.Object stream, int level)static java.lang.StringHEstring(int error_code)static shortHEvalue(int level)static booleanHgetfileversion(long file_id, int[] vers, java.lang.String[] string)Note: the version of an HDF file is not well defined, it is not recommended that programs rely on these numbers.static booleanHgetlibversion(int[] vers, java.lang.String[] string)static booleanHishdf(java.lang.String fileName)static intHnumber(long fid)static intHnumber(long fid, int tagtype)static longHopen(java.lang.String filename)static longHopen(java.lang.String filename, int access)static longHopen(java.lang.String filename, int access, int ndds)static booleanHsetaccesstype(long h_id, int access_type)static booleanHsync(long file_id)static booleanHXsetcreatedir(java.lang.String dir)static booleanHXsetdir(java.lang.String dir)static voidloadH4Lib()static booleanSDattrinfo(long id, int index, java.lang.String[] name, int[] argv)static booleanSDcheckempty(long sdsid, int[] emptySDS)static longSDcreate(long sd_id, java.lang.String name, long number_type, int rank, int[] dimsizes)static booleanSDdiminfo(long dimid, java.lang.String[] name, int[] argv)static booleanSDend(long sdid)static booleanSDendaccess(long sdsid)static booleanSDfileinfo(long sdid, int[] argv)static longSDfindattr(long id, java.lang.String name)static booleanSDgetcal(long sdsid, double[] argv, int[] NT)static booleanSDgetchunkinfo(long sdsid, HDFChunkInfo chunk_def, int[] clflags)static booleanSDgetcompinfo(long id, HDFCompInfo cinfo)static booleanSDgetdatastrs(long sdsid, java.lang.String[] strings, int len)static longSDgetdimid(long sdsid, int index)static booleanSDgetdimscale(long dimid, byte[] data)static booleanSDgetdimscale(long dimid, java.lang.Object theData)static booleanSDgetdimstrs(long dimid, java.lang.String[] args, int len)static booleanSDgetfillvalue(long sdsid, byte[] fillValue)static booleanSDgetfillvalue(long sdsid, java.lang.Object[] theFillValue)static booleanSDgetinfo(long sdsid, java.lang.String[] name, int[] dimsizes, int[] args)static booleanSDgetrange(long sdsid, byte[] max, byte[] min)static booleanSDgetrange(long sdsid, double[] maxmin)static intSDidtoref(long sdsid)static booleanSDiscoordvar(long sdsid)static booleanSDisdimval_bwcomp(long dimid)static booleanSDisrecord(long sdsid)static intSDnametoindex(long sdid, java.lang.String name)static booleanSDreadattr(long id, int index, byte[] data)static booleanSDreadattr(long id, int index, java.lang.Object theData)static booleanSDreadchunk(long sdsid, int[] origin, byte[] theData)static booleanSDreadchunk(long sdsid, int[] origin, java.lang.Object theData)static booleanSDreaddata(long sdsid, int[] start, int[] stride, int[] count, byte[] data)static booleanSDreaddata(long sdsid, int[] start, int[] stride, int[] count, java.lang.Object theData)static booleanSDreaddata_double(long sdsid, int[] start, int[] stride, int[] count, double[] theData)static booleanSDreaddata_float(long sdsid, int[] start, int[] stride, int[] count, float[] theData)static booleanSDreaddata_int(long sdsid, int[] start, int[] stride, int[] count, int[] theData)static booleanSDreaddata_long(long sdsid, int[] start, int[] stride, int[] count, long[] theData)static booleanSDreaddata_short(long sdsid, int[] start, int[] stride, int[] count, short[] theData)static intSDreftoindex(long sdid, int ref)static longSDselect(long sdid, int index)static booleanSDsetaccesstype(long id, int accesstype)static booleanSDsetattr(long s_id, java.lang.String attr_name, long num_type, int count, byte[] values)static booleanSDsetattr(long s_id, java.lang.String attr_name, long num_type, int count, java.lang.Object theValues)static booleanSDsetblocksize(long sdsid, int block_size)static booleanSDsetcal(long sds_id, double cal, double cal_err, double offset, double offset_err, int number_type)static booleanSDsetchunk(long sdsid, HDFChunkInfo chunk_def, int flags)static intSDsetchunkcache(long sdsid, int maxcache, int flags)static booleanSDsetcompress(long id, int type, HDFCompInfo cinfo)static booleanSDsetdatastrs(long sds_id, java.lang.String label, java.lang.String unit, java.lang.String format, java.lang.String coordsys)static booleanSDsetdimname(long dim_id, java.lang.String dim_name)static booleanSDsetdimscale(long dim_id, int count, int number_type, byte[] data)static booleanSDsetdimscale(long dim_id, int count, int number_type, java.lang.Object theData)static booleanSDsetdimstrs(long dim_id, java.lang.String label, java.lang.String unit, java.lang.String format)static booleanSDsetdimval_comp(long dimid, int comp_mode)static booleanSDsetexternalfile(long sds_id, java.lang.String filename, int offset)static booleanSDsetfillmode(long sdsid, boolean fill_enable)static booleanSDsetfillmode(long sdsid, int fillmode)static booleanSDsetfillvalue(long sds_id, byte[] fill_val)static booleanSDsetfillvalue(long sds_id, java.lang.Object the_fill_val)static booleanSDsetnbitdataset(long id, int start_bit, int bit_len, int sign_ext, int fill_one)static booleanSDsetrange(long sdsid, byte[] max, byte[] min)static booleanSDsetrange(long sdsid, java.lang.Object max, java.lang.Object min)static longSDstart(java.lang.String filename, int accessmode)static booleanSDwritechunk(long sdsid, int[] origin, byte[] data)static booleanSDwritechunk(long sdsid, int[] origin, java.lang.Object theData)static booleanSDwritedata(long sdsid, int[] start, int[] stride, int[] count, byte[] data)static booleanSDwritedata(long sdsid, int[] start, int[] stride, int[] count, java.lang.Object theData)static intVaddtagref(long vgroup_id, int tag, int ref)static intVattach(long fid, int vgroup_ref, java.lang.String access)static booleanVattrinfo(long id, int index, java.lang.String[] name, int[] argv)static intVdeletetagref(long vgroup_id, int tag, int ref)static voidVdetach(long vgroup_id)static voidVend(long file_id)static intVFfieldesize(long vdata_id, int field_index)static intVFfieldisize(long vdata_id, int field_index)static java.lang.StringVFfieldname(long vdata_id, int field_index)static intVFfieldorder(long vdata_id, int field_index)static longVFfieldtype(long vdata_id, int field_index)static intVfind(long file_id, java.lang.String vgroup_name)static longVfindattr(long id, java.lang.String name)static intVfindclass(long file_id, java.lang.String vgclassname)static intVflocate(int key, java.lang.String vgclassname)static intVFnfields(long vkey)static booleanVgetattr(long id, int index, byte[] data)static booleanVgetattr(long id, int index, java.lang.Object theData)static voidVgetclass(long vgroup_id, java.lang.String[] hdfclassname)static intVgetid(long file_id, int vgroup_ref)static voidVgetname(long vgroup_id, java.lang.String[] hdfname)static intVgetnext(int key, int ref)static booleanVgettagref(long vgroup_id, int index, int[] tagref)static intVgettagrefs(long vgroup_id, int[] tags, int[] refs, int arraysize)static intVgetversion(long id)static intVHmakegroup(long file_id, int[] tag_array, int[] ref_array, int n_objects, java.lang.String vgroup_name, java.lang.String vgroup_class)static intVHstoredata(long file_id, java.lang.String fieldname, byte[] buf, int n_records, int data_type, java.lang.String vdata_name, java.lang.String vdata_class)static intVHstoredata(long file_id, java.lang.String fieldname, java.lang.Object thebuf, int n_records, int data_type, java.lang.String vdata_name, java.lang.String vdata_class)static intVHstoredatam(long file_id, java.lang.String fieldname, byte[] buf, int n_records, int data_type, java.lang.String vdata_name, java.lang.String vdata_class, int order)static intVHstoredatam(long file_id, java.lang.String fieldname, java.lang.Object buf, int n_records, int data_type, java.lang.String vdata_name, java.lang.String vdata_class, int order)static booleanVinqtagref(long vgroup_id, int tag, int ref)static booleanVinquire(long vgroup_id, int[] n_entries, java.lang.String[] vgroup_name)static intVinsert(long vgroup_id, long v_id)static booleanVisvg(long vgroup_id, int vgroup_ref)static booleanVisvs(long vgroup_id, int vdata_ref)static intVlone(long fid, int[] ref_array, int buffersize)static intVnattrs(long id)static intVnrefs(int key, int ref)static intVntagrefs(long vgroup_id)static intVQueryref(long vkey)static intVQuerytag(long vkey)static booleanVSappendable(int vkey, int block_size)static intVSattach(long fid, int vdata_ref, java.lang.String access)static booleanVSattrinfo(long id, int index, int attr_index, java.lang.String[] name, int[] argv)static voidVSdetach(long vdata_id)static intVSelts(long vdata_id)static booleanVsetattr(long id, java.lang.String attr_name, long data_type, int count, byte[] data)static booleanVsetattr(long id, java.lang.String attr_name, long data_type, int count, java.lang.Object theData)static booleanVsetattr(long id, java.lang.String attr_name, long data_type, int count, java.lang.String values)static booleanVsetclass(long vgroup_id, java.lang.String vgclassname)static booleanVsetname(long vgroup_id, java.lang.String vgname)static booleanVSfdefine(long vdata_id, java.lang.String fieldname, int numbertype, int order)static booleanVSfexist(long vdata_id, java.lang.String fields)static intVSfind(long file_id, java.lang.String vdataname)static intVSfindattr(long id, int index, java.lang.String name)static intVSfindclass(long file_id, java.lang.String vgclass)static intVSfindex(long id, java.lang.String name, int[] findex)static intVSfnattrs(long id, int fnattrs)static booleanVSgetattr(long id, int index, int attr_index, byte[] data)static booleanVSgetattr(long id, int index, int attr_index, java.lang.Object theData)static voidVSgetclass(long vdata_id, java.lang.String[] hdfclassname)static intVSgetfields(long vdata_id, java.lang.String[] fieldname)static longVSgetid(long file_id, int vdata_ref)static intVSgetinterlace(long vdata_id)static voidVSgetname(long vdata_id, java.lang.String[] hdfname)static intVSgetversion(int vkey)static booleanVSinquire(long vdata_id, int[] iargs)static booleanVSinquire(long vdata_id, int[] iargs, java.lang.String[] sargs)static booleanVSisattr(long id)static intVSlone(long fid, int[] ref_array, int buffersize)static intVSnattrs(long id)static booleanVSQuerycount(long vdata_id, int[] n_records)static booleanVSQueryfields(long vdata_id, java.lang.String[] fields)static booleanVSQueryinterlace(long vdata_id, int[] interlace)static booleanVSQueryname(long vdata_id, java.lang.String[] vdata_name)static intVSQueryref(long vdata_id)static intVSQuerytag(long vdata_id)static booleanVSQueryvsize(long vdata_id, int[] vdata_size)static intVSread(long vdata_id, byte[] databuf, int nrecord, int interlace)static intVSread(long vdata_id, java.lang.Object theData, int nrecord, int interlace)static intVSseek(long vdata_id, int record)static booleanVSsetattr(long id, int index, java.lang.String attr_name, long data_type, int count, byte[] values)static booleanVSsetattr(long id, int index, java.lang.String attr_name, long data_type, int count, java.lang.Object theData)static booleanVSsetattr(long id, int index, java.lang.String attr_name, long data_type, int count, java.lang.String values)static intVSsetblocksize(long vdata_id, int blocksize)static voidVSsetclass(long vdata_id, java.lang.String vdata_class)static booleanVSsetexternalfile(int vkey, java.lang.String filename, int offset)static booleanVSsetfields(long vdata_id, java.lang.String fields)static booleanVSsetinterlace(long vdata_id, int interlace)static voidVSsetname(long vdata_id, java.lang.String vdata_name)static intVSsetnumblocks(long vdata_id, int numblocks)static intVSsizeof(long vdata_id, java.lang.String fields)static booleanVstart(long fid)static intVSwrite(long vdata_id, byte[] databuf, int n_records, int interlace)static intVSwrite(long vdata_id, java.lang.Object databuf, int n_records, int interlace)
-
-
-
Field Detail
-
HDFPATH_PROPERTY_KEY
public static final java.lang.String HDFPATH_PROPERTY_KEY
- See Also:
- Constant Field Values
-
H4_LIBRARY_NAME_PROPERTY_KEY
public static final java.lang.String H4_LIBRARY_NAME_PROPERTY_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
loadH4Lib
public static void loadH4Lib()
-
getJHIVersion
@Deprecated public static final java.lang.String getJHIVersion()
Deprecated.
-
Hopen
public static long Hopen(java.lang.String filename) throws HDFException- Throws:
HDFException
-
Hopen
public static long Hopen(java.lang.String filename, int access) throws HDFException- Throws:
HDFException
-
Hopen
public static long Hopen(java.lang.String filename, int access, int ndds) throws HDFException- Throws:
HDFException
-
Hclose
public static boolean Hclose(long fid) throws HDFException- Throws:
HDFException
-
HDdont_atexit
public static int HDdont_atexit() throws HDFException- Throws:
HDFException
-
Hishdf
public static boolean Hishdf(java.lang.String fileName) throws HDFException- Throws:
HDFException
-
Hnumber
public static int Hnumber(long fid) throws HDFException- Throws:
HDFException
-
Hnumber
public static int Hnumber(long fid, int tagtype) throws HDFException- Throws:
HDFException
-
DFKNTsize
public static int DFKNTsize(long numbertype) throws HDFException- Throws:
HDFException
-
HDgetNTdesc
public static java.lang.String HDgetNTdesc(int nt) throws HDFException- Throws:
HDFException
-
Hcache
public static boolean Hcache(long file_id, int cache_switch) throws HDFException- Throws:
HDFException
-
Hgetfileversion
public static boolean Hgetfileversion(long file_id, int[] vers, java.lang.String[] string) throws HDFExceptionNote: the version of an HDF file is not well defined, it is not recommended that programs rely on these numbers.- Parameters:
file_id- IN: long, the file descriptor returned by Hopenvers- OUT: int[3], the major version, minor version, and release number of the file.string- OUT: String[1], the version string- Returns:
- the major, minor, and release number are returned in the array of ints, and a string is returned in the string.
- Throws:
HDFException- thrown for errors in the HDF library call.
-
Hgetlibversion
public static boolean Hgetlibversion(int[] vers, java.lang.String[] string) throws HDFException- Parameters:
vers- OUT: int[3], the major version, minor version, and release number of the HDF library.string- OUT: String[1], the version string- Returns:
- the major, minor, and release number are returned in the array of ints, and a string is returned in the string.
- Throws:
HDFException- thrown for errors in the HDF library call.
-
Hsetaccesstype
public static boolean Hsetaccesstype(long h_id, int access_type) throws HDFException- Throws:
HDFException
-
Hsync
public static boolean Hsync(long file_id) throws HDFException- Throws:
HDFException
-
ANstart
public static int ANstart(long fid) throws HDFException- Throws:
HDFException
-
ANend
public static boolean ANend(long an_id) throws HDFException- Throws:
HDFException
-
ANendaccess
public static boolean ANendaccess(long an_id) throws HDFException- Throws:
HDFException
-
ANfileinfo
public static boolean ANfileinfo(long an_id, int[] info) throws HDFException- Parameters:
an_id- IN: the AN interface id, returned by ANstartinfo- OUT: int[4], n_file_label, n_file_desc, n_data_label, n_data_desc- Returns:
- four integer parameters: info[0] = n_file_label, info[1] = n_file_desc, info[2] = n_data_label, info[3] = n_data_desc
- Throws:
HDFException- should be thrown for errors.
-
ANselect
public static int ANselect(long an_id, int index, int anntype) throws HDFException- Throws:
HDFException
-
ANnumann
public static int ANnumann(long an_id, int anntype, short tag, short ref) throws HDFException- Throws:
HDFException
-
ANatype2tag
public static short ANatype2tag(int antag) throws HDFException- Throws:
HDFException
-
ANtag2atype
public static int ANtag2atype(short anttype) throws HDFException- Throws:
HDFException
-
ANannlist
public static int ANannlist(long an_id, int anntype, short tag, short ref, int[] ann_list) throws HDFException- Parameters:
an_id- IN: the AN interface id, returned by ANstartanntype- IN: the number type, as defined in HDFConstantstag- IN: the HDF tagref- IN: the HDF refann_list- OUT: int[], an array of annotation identifiers. The array must be long enough to hold the number of annotations returned by ANnumann- Returns:
- an array of integers, which are the identifiers of the annotations
- Throws:
HDFException- should be thrown for errors.
-
ANannlen
public static int ANannlen(long ann_id) throws HDFException- Throws:
HDFException
-
ANreadann
public static boolean ANreadann(long ann_id, java.lang.String[] annbuf, int maxlen) throws HDFException- Parameters:
ann_id- IN: the AN interface id, returned by ANstartannbuf- OUT: String[1], the annotation is returned as annbuf[0].maxlen- IN: int, the maximum length of the string.- Returns:
- an annotation string: annbuf[0] = the annotation
- Throws:
HDFException- should be thrown for errors.
-
ANcreate
public static int ANcreate(long an_id, short tag, short ref, int type) throws HDFException- Throws:
HDFException
-
ANcreatef
public static int ANcreatef(long an_id, int type) throws HDFException- Throws:
HDFException
-
ANget_tagref
public static int ANget_tagref(long an_id, int index, int type, short[] tagref) throws HDFException- Parameters:
an_id- IN: the AN interface id, returned by ANstartindex- IN: the index of the annotationtype- IN: the type of the annotationtagref- OUT: short[2], the tag and ref of the annotation- Returns:
- the tag and ref: tagref[0] = tag, tagref[1] = ref
- Throws:
HDFException- should be thrown for errors.
-
ANid2tagref
public static boolean ANid2tagref(long an_id, short[] tagref) throws HDFException- Parameters:
an_id- IN: the AN interface id, returned by ANstarttagref- OUT: short[2], the tag and ref of the annotation- Returns:
- the tag and ref: tagref[0] = tag, tagref[1] = ref
- Throws:
HDFException- should be thrown for errors.
-
ANtagref2id
public static long ANtagref2id(long an_id, short tag, short ref) throws HDFException- Throws:
HDFException
-
ANwriteann
public static boolean ANwriteann(long ann_id, java.lang.String label, int ann_length) throws HDFException- Throws:
HDFException
-
DFPaddpal
public static boolean DFPaddpal(java.lang.String filename, byte[] palette) throws HDFException- Throws:
HDFException
-
DFPgetpal
public static boolean DFPgetpal(java.lang.String filename, byte[] palette) throws HDFException- Throws:
HDFException
-
DFPlastref
public static short DFPlastref() throws HDFException- Throws:
HDFException
-
DFPnpals
public static int DFPnpals(java.lang.String filename) throws HDFException- Throws:
HDFException
-
DFPputpal
public static boolean DFPputpal(java.lang.String filename, byte[] palette, int overwrite, java.lang.String filemode) throws HDFException- Throws:
HDFException
-
DFPputpal
public static boolean DFPputpal(java.lang.String filename, byte[] palette, boolean overwrite, java.lang.String filemode) throws HDFException- Parameters:
filename- IN: String, the name of the HDF filepalette- IN: byte[] the paletteoverwrite- IN: boolean, converted to 1 == true, 0 == false to call the HDF libraryfilemode- IN: if "a" append palette to file, "w" create new file- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.
-
DFPreadref
public static boolean DFPreadref(java.lang.String filename, short ref) throws HDFException- Throws:
HDFException
-
DFPrestart
public static short DFPrestart() throws HDFException- Throws:
HDFException
-
DFPwriteref
public static boolean DFPwriteref(java.lang.String filename, short ref) throws HDFException- Throws:
HDFException
-
GRstart
public static int GRstart(long fid) throws HDFException- Throws:
HDFException
-
GRend
public static boolean GRend(long grid) throws HDFException- Throws:
HDFException
-
GRfileinfo
public static boolean GRfileinfo(long grid, int[] args) throws HDFException- Parameters:
grid- IN: the GR interface id, returned by GRstartargs- OUT: int[2], n_datasets and n_file_attrs- Returns:
- the file info: args[0] = n_datasets, args[1] = n_file_attrs
- Throws:
HDFException- should be thrown for errors.
-
GRgetchunkinfo
public static boolean GRgetchunkinfo(long sdsid, HDFChunkInfo chunk_def, int[] flag) throws HDFException- Parameters:
sdsid- IN: the SD identifier returned by SDselectchunk_def- OUT: HDFChunkInfo, the chunking infoflag- OUT: int[1], the type of chunking- Returns:
- c_info contains information about the chunking method, flags[0] == the chunking flags
NOTE:The chunking algorithm-specific information is passed in an appropriate sub-class of HDFChunkInfo.
- Throws:
HDFException- should be thrown for errors.
-
GRselect
public static int GRselect(long grid, int index) throws HDFException- Throws:
HDFException
-
GRnametoindex
public static int GRnametoindex(long grid, java.lang.String name) throws HDFException- Throws:
HDFException
-
GRgetiminfo
public static boolean GRgetiminfo(long grid, java.lang.String[] gr_name, int[] args, int[] dim_sizes) throws HDFException- Parameters:
grid- IN: the GR interface id, returned by GRstartgr_name- OUT: name of raster imageargs- OUT: int[4], image info: number of components in the image, data type of the image data, interlace mode of the stored image data, number of attributes assigned to the imagedim_sizes- OUT: int[2], dim_sizes- Returns:
- the file info: String[0] = gr_name, args[0] = ncomp, args[1] = data_type, args[2] =
interlace, args[3] = num_attrs
NOTE: the parameters for the Java interface are not in the same order as the C interface.
- Throws:
HDFException- should be thrown for errors.
-
GRreadimage
public static boolean GRreadimage(long grid, int[] start, int[] stride, int[] count, byte[] data) throws HDFException- Parameters:
grid- IN: the GR interface id, returned by GRstartstart- IN: int[2], startstride- IN: int[2], stride. If the stride parameter is set to NULL, a stride of 1 will be assumed. strides of 0 are illegal.count- IN: int[2], countdata- OUT: byte[], data- Returns:
- the the data in the form of a continuous array of bytes.
NOTE: to read into a Java 2D array use the alternative routine below.
- Throws:
HDFException- should be thrown for errors.
-
GRreadimage
public static boolean GRreadimage(long grid, int[] start, int[] stride, int[] count, java.lang.Object theData) throws HDFException- Parameters:
grid- IN: the GR interface id, returned by GRstartstart- IN: int[2], startstride- IN: int[2], stride. If the stride parameter is set to NULL, a stride of 1 will be assumed. strides of 0 are illegal.count- IN: int[2], counttheData- OUT: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- the the data in the Java array.
Note: reads the data as bytes and converts to the Java array.
- Throws:
HDFException- should be thrown for errors.
-
GRendaccess
public static boolean GRendaccess(long riid) throws HDFException- Throws:
HDFException
-
GRidtoref
public static short GRidtoref(long riid) throws HDFException- Throws:
HDFException
-
GRreftoindex
public static int GRreftoindex(long grid, short ref) throws HDFException- Throws:
HDFException
-
GRreqlutil
public static boolean GRreqlutil(long riid, int interlace) throws HDFException- Throws:
HDFException
-
GRreqimageil
public static boolean GRreqimageil(long rrid, int interlace) throws HDFException- Throws:
HDFException
-
GRgetlutid
public static int GRgetlutid(long rrid, int index) throws HDFException- Throws:
HDFException
-
GRgetnluts
public static int GRgetnluts(long rrid) throws HDFException- Throws:
HDFException
-
GRgetlutinfo
public static boolean GRgetlutinfo(long lutid, int[] args) throws HDFException- Parameters:
lutid- IN: the palette identifier returned by GRgetlutidargs- OUT: int[4], palette info: Number of components in the palette, Data type of the palette data, Interlace mode of the stored palette data, Number of color lookup table entries in the palette.- Returns:
- the palette info: args[0] = ncomp, args[1] = data_type, args[2] = interlace, args[3] = num_entries
- Throws:
HDFException- should be thrown for errors.
-
GRreadlut
public static boolean GRreadlut(long lutid, byte[] data) throws HDFException- Parameters:
lutid- IN: the palette identifier returned by GRgetlutiddata- OUT: byte[], palette data, in bytes- Returns:
- the palette data: as bytes
NOTE: to read into a Java 1D array use the alternative routine below.
- Throws:
HDFException- should be thrown for errors.
-
GRreadlut
public static boolean GRreadlut(long lutid, java.lang.Object theData) throws HDFException- Parameters:
lutid- IN: the palette identifier returned by GRgetlutidtheData- OUT: Object, palette data, an Java array- Returns:
- the palette data: as a Java array
Note: reads the data as bytes and converts to the Java array.
- Throws:
HDFException- should be thrown for errors.
-
GRattrinfo
public static boolean GRattrinfo(long id, int index, java.lang.String[] name, int[] argv) throws HDFException- Parameters:
id- IN: the GR identifier returned by GRstartindex- IN: the index of the attributename- OUT: String[1], the name of the attributeargv- OUT: int[2], the type and length of the attribute- Returns:
- the name, type, and length of the attribute: name[0] = name, argv[0] = data_type, argv[1] = length
- Throws:
HDFException- should be thrown for errors.
-
GRgetattr
public static boolean GRgetattr(long id, int index, byte[] data) throws HDFException- Parameters:
id- IN: the GR identifier returned by GRstartindex- IN: index of the attribute for infodata- OUT: byte[], attribute data, in bytes- Returns:
- the attribute data: as bytes
NOTE: to read into a Java 1D array use the alternative routine below.
- Throws:
HDFException- should be thrown for errors.
-
GRgetattr
public static boolean GRgetattr(long id, int index, java.lang.Object theData) throws HDFException- Parameters:
id- IN: the GR identifier returned by GRstartindex- IN: index of the attribute for infotheData- OUT: Object, attribute data, an Java array- Returns:
- the attribute data: as a Java array
Note: reads the data as bytes and converts to the Java array.
- Throws:
HDFException- should be thrown for errors.
-
GRfindattr
public static int GRfindattr(long id, java.lang.String name) throws HDFException- Throws:
HDFException
-
GRcreate
public static int GRcreate(long gr_id, java.lang.String name, int ncomp, long data_type, int interlace_mode, int[] dim_sizes) throws HDFException- Throws:
HDFException
-
GRluttoref
public static short GRluttoref(long pal_id) throws HDFException- Throws:
HDFException
-
GRsetattr
public static boolean GRsetattr(long gr_id, java.lang.String attr_name, long data_type, int count, java.lang.String values) throws HDFException- Parameters:
gr_id- IN: the GR identifier returned by GRstartattr_name- IN: the name of the attributedata_type- IN: the number type of the data (should be DFNT_CHAR)count- IN: the length the data (length of 'values')values- IN: the the attribute to write -- A String- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE:This routine writes a attribute that is a String. Alternative methods write data of other types.
-
GRsetattr
public static boolean GRsetattr(long gr_id, java.lang.String attr_name, long data_type, int count, byte[] values) throws HDFException- Parameters:
gr_id- IN: the GR identifier returned by GRstartattr_name- IN: the name of the attributedata_type- IN: the number type of the datacount- IN: the length the data (length of 'values')values- IN: the the attribute to write -- in an array of bytes- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE:This routine writes the attribute as an array of bytes. DO NOT USE THIS TO WRITE A STRING. This is intended for numeric data that has been flattened into bytes.
-
GRsetattr
public static boolean GRsetattr(long gr_id, java.lang.String attr_name, long data_type, int count, java.lang.Object theData) throws HDFException- Parameters:
gr_id- IN: the GR identifier returned by GRstartattr_name- IN: the name of the attributedata_type- IN: the number type of the datacount- IN: the length the data (length of 'values')theData- IN: Object -- the value to be written, a Java array of numbers.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE:This routine converts the Java array to bytes then writes it. DO NOT USE THIS TO WRITE A STRING.
-
GRsetchunk
public static boolean GRsetchunk(long sdsid, HDFChunkInfo chunk_def, int flags) throws HDFException- Parameters:
sdsid- IN: the SD identifier returned by SDselectchunk_def- IN: HDFChunkInfo, the chunking infoflags- IN: the type of chunking- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE:The chunking algorithm-specific information is passed in an appropriate sub-class of HDFChunkInfo.
-
GRsetchunkcache
public static int GRsetchunkcache(long sdsid, int maxcache, int flags) throws HDFException- Throws:
HDFException
-
GRsetcompress
public static boolean GRsetcompress(long ri_id, int comp_type, HDFCompInfo c_info) throws HDFException- Parameters:
ri_id- IN: the GR identifier returned by GRstartcomp_type- IN: the type of compressionc_info- IN: HDFCompInfo, the compression info- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE:The compression algorithm specific information is passed in an appropriate sub-class of HDFCompInfo.
-
GRgetcompress
public static boolean GRgetcompress(long ri_id, HDFCompInfo c_info) throws HDFException- Throws:
HDFException
-
GRgetcompinfo
public static boolean GRgetcompinfo(long ri_id, HDFCompInfo c_info) throws HDFException- Throws:
HDFException
-
GRsetexternalfile
public static boolean GRsetexternalfile(long ri_id, java.lang.String filename, int offset) throws HDFException- Throws:
HDFException
-
GRwriteimage
public static boolean GRwriteimage(long grid, int[] start, int[] stride, int[] edge, byte[] data) throws HDFException- Parameters:
grid- IN: the GR interface id, returned by GRstartstart- IN: int[2], startstride- IN: int[2], stride. If the stride parameter is set to NULL, a stride of 1 will be assumed. strides of 0 are illegal.edge- IN: int[2], countdata- IN: byte[], data to be written- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE: to write from a Java 2D array use the alternative routine below.
-
GRwriteimage
public static boolean GRwriteimage(long grid, int[] start, int[] stride, int[] edge, java.lang.Object theData) throws HDFException- Parameters:
grid- IN: the GR interface id, returned by GRstartstart- IN: int[2], startstride- IN: int[2], stride. If the stride parameter is set to NULL, a stride of 1 will be assumed. strides of 0 are illegal.edge- IN: int[2], counttheData- IN: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: converts the Java array to a contiguous block of bytes appropriate for C, and then writes the bytes.
-
GRwritelut
public static boolean GRwritelut(long pal_id, int ncomp, int data_type, int interlace, int num_entries, byte[] pal_data) throws HDFException- Parameters:
pal_id- IN: the palette identifier returned by GRgetlutidncomp- IN: int, number of componentsdata_type- IN: int, number typeinterlace- IN: int, interlacenum_entries- IN: int, number of entriespal_data- IN: byte[], palette data to be written--as bytes- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE: to write from a Java array of numbers use the alternative routine below.
-
GRwritelut
public static boolean GRwritelut(long pal_id, int ncomp, int data_type, int interlace, int num_entries, java.lang.Object theData) throws HDFException- Parameters:
pal_id- IN: the palette identifier returned by GRgetlutidncomp- IN: int, number of componentsdata_type- IN: int, number typeinterlace- IN: int, interlacenum_entries- IN: int, number of entriestheData- IN: Object, palette data to be written, any number type.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: converts the Java array to a contiguous block of bytes appropriate for C, and then writes the bytes.
-
GRreadchunk
public static boolean GRreadchunk(long sdsid, int[] origin, byte[] theData) throws HDFException- Parameters:
sdsid- IN: the GR interface id, returned by SDselectorigin- IN: int[], origintheData- OUT: byte[], the data in an array of bytes- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE: to read into a Java array use the alternative routine below.
-
GRreadchunk
public static boolean GRreadchunk(long grid, int[] origin, java.lang.Object theData) throws HDFException- Parameters:
grid- IN: the GR interface id, returned by SDselectorigin- IN: int[], origintheData- IN: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: reads the data as a contiguous array of bytes and then converts it to an appropriate Java object.
-
HDFclose
public static boolean HDFclose(long file_id) throws HDFException- Throws:
HDFException
-
HDFopen
public static long HDFopen(java.lang.String filename, int access, short n_dds) throws HDFException- Throws:
HDFException
-
HEvalue
public static short HEvalue(int level) throws HDFException- Throws:
HDFException
-
HEstring
public static java.lang.String HEstring(int error_code) throws HDFException- Throws:
HDFException
-
HEprint
public static void HEprint(java.lang.Object stream, int level) throws HDFException- Throws:
HDFException
-
HXsetcreatedir
public static boolean HXsetcreatedir(java.lang.String dir) throws HDFException- Throws:
HDFException
-
HXsetdir
public static boolean HXsetdir(java.lang.String dir) throws HDFException- Throws:
HDFException
-
SDstart
public static long SDstart(java.lang.String filename, int accessmode) throws HDFException- Throws:
HDFException
-
SDend
public static boolean SDend(long sdid) throws HDFException- Throws:
HDFException
-
SDfileinfo
public static boolean SDfileinfo(long sdid, int[] argv) throws HDFException- Parameters:
sdid- IN: the SD interface id, returned by SDstartargv- OUT: int[2], Number of datasets in the file, Number of global attributes in the file- Returns:
- the file info: argv[0] = n_datasets, argv[1] = n_file_attrs
- Throws:
HDFException- should be thrown for errors.
-
SDselect
public static long SDselect(long sdid, int index) throws HDFException- Throws:
HDFException
-
SDnametoindex
public static int SDnametoindex(long sdid, java.lang.String name) throws HDFException- Throws:
HDFException
-
SDgetinfo
public static boolean SDgetinfo(long sdsid, java.lang.String[] name, int[] dimsizes, int[] args) throws HDFException- Parameters:
sdsid- IN: the SD interface id, returned by SDselectname- OUT: String[1], the name of the datasetargs- OUT: int[3], dataset info: number of dimensions (rank), data type for the data stored in the dataset, number of "netCDF-style" attributes for this datasetdimsizes- OUT: int[(rank)], sizes of dimensions- Returns:
- the file info: name[0] = gr_name, args[0] = rank, args[1] = data_type, args[2] = nattrs,
dim_sizes[] = dimensions
NOTE: the parameters for the Java interface are not in the same order as the C interface.
- Throws:
HDFException- should be thrown for errors.
-
SDcheckempty
public static boolean SDcheckempty(long sdsid, int[] emptySDS) throws HDFException- Parameters:
sdsid- IN: the SD interface id, returned by SDselectemptySDS- OUT: int[1], 1 if the SDS is empty, 0 if has data- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.
-
SDreaddata
public static boolean SDreaddata(long sdsid, int[] start, int[] stride, int[] count, byte[] data) throws HDFException- Parameters:
sdsid- IN: the SD interface id, returned by SDselectstart- IN: int[], startstride- IN: int[], stridecount- IN: int[], countdata- OUT: byte[], data- Returns:
- the the data in the form of a continuous array of bytes.
NOTE: to read into a Java array use the alternative routine below.
- Throws:
HDFException- should be thrown for errors.
-
SDreaddata
public static boolean SDreaddata(long sdsid, int[] start, int[] stride, int[] count, java.lang.Object theData) throws HDFException- Parameters:
sdsid- IN: the SD interface id, returned by SDselectstart- IN: int[], startstride- IN: int[], stridecount- IN: int[], counttheData- OUT: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- the the data in the Java array.
Note: reads the data as bytes and converts to the Java array.
- Throws:
HDFException- should be thrown for errors.
-
SDreaddata_short
public static boolean SDreaddata_short(long sdsid, int[] start, int[] stride, int[] count, short[] theData) throws HDFException- Throws:
HDFException
-
SDreaddata_int
public static boolean SDreaddata_int(long sdsid, int[] start, int[] stride, int[] count, int[] theData) throws HDFException- Throws:
HDFException
-
SDreaddata_long
public static boolean SDreaddata_long(long sdsid, int[] start, int[] stride, int[] count, long[] theData) throws HDFException- Throws:
HDFException
-
SDreaddata_float
public static boolean SDreaddata_float(long sdsid, int[] start, int[] stride, int[] count, float[] theData) throws HDFException- Throws:
HDFException
-
SDreaddata_double
public static boolean SDreaddata_double(long sdsid, int[] start, int[] stride, int[] count, double[] theData) throws HDFException- Throws:
HDFException
-
SDendaccess
public static boolean SDendaccess(long sdsid) throws HDFException- Throws:
HDFException
-
SDgetdimid
public static long SDgetdimid(long sdsid, int index) throws HDFException- Throws:
HDFException
-
SDdiminfo
public static boolean SDdiminfo(long dimid, java.lang.String[] name, int[] argv) throws HDFException- Parameters:
dimid- IN: the dimension id, returned by SDgetdimidname- OUT: String[1], the dimension nameargv- OUT: int[3], size of the name string, number type of data in the array, # attributes for the dimension- Returns:
- name[0] = name, argv[0] = count, argv[1] = data_type, argv[2] = nattr
- Throws:
HDFException- should be thrown for errors.
-
SDidtoref
public static int SDidtoref(long sdsid) throws HDFException- Throws:
HDFException
-
SDreftoindex
public static int SDreftoindex(long sdid, int ref) throws HDFException- Throws:
HDFException
-
SDattrinfo
public static boolean SDattrinfo(long id, int index, java.lang.String[] name, int[] argv) throws HDFException- Parameters:
id- IN: id of a file, SDS, or dimensionindex- IN: index of the attributename- OUT: String[1], the name of the attributeargv- OUT: int[2], number type of the attribute, number of values in the attribute- Returns:
- name[0] = attr_name, argv[0] = data_type, argv[1] = count
- Throws:
HDFException- should be thrown for errors.
-
SDreadattr
public static boolean SDreadattr(long id, int index, byte[] data) throws HDFException- Parameters:
id- IN: id of a file, SDS, or dimensionindex- IN: index of the attributedata- OUT: byte[], data- Returns:
- the the data in the form of a continuous array of bytes.
NOTE: to read into a Java array use the alternative routine below.
- Throws:
HDFException- should be thrown for errors.
-
SDreadattr
public static boolean SDreadattr(long id, int index, java.lang.Object theData) throws HDFException- Parameters:
id- IN: id of a file, SDS, or dimensionindex- IN: index of the attributetheData- OUT: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- the the data in the Java array.
Note: reads the data as bytes and converts to the Java array.
- Throws:
HDFException- should be thrown for errors.
-
SDfindattr
public static long SDfindattr(long id, java.lang.String name) throws HDFException- Throws:
HDFException
-
SDiscoordvar
public static boolean SDiscoordvar(long sdsid) throws HDFException- Throws:
HDFException
-
SDgetcal
public static boolean SDgetcal(long sdsid, double[] argv, int[] NT) throws HDFException- Parameters:
sdsid- IN: id of the SDS as returned by SDselectargv- OUT: double[4], calibration information: calibration factor calibration error offset offset errorNT- OUT: int[1], number type of uncalibrated data- Returns:
- argv[0] = cal, argv[1] = cal_err, argv[2] = offset, argv[3] = offset_err, NT[0] = data_type
- Throws:
HDFException- should be thrown for errors.
-
SDgetdatastrs
public static boolean SDgetdatastrs(long sdsid, java.lang.String[] strings, int len) throws HDFException- Parameters:
sdsid- IN: id of the SDS as returned by SDselectstrings- OUT: String[4], data information strings: label unit print format coordinate systemlen- IN: int, max len of string (not needed by Java -- the HDFLibrary interface will handle this)- Returns:
- strings[0] = label, strings[1] = unit, strings[2] = format, strings[3] = coordsys,
- Throws:
HDFException- should be thrown for errors.
-
SDgetdimstrs
public static boolean SDgetdimstrs(long dimid, java.lang.String[] args, int len) throws HDFException- Parameters:
dimid- IN: id of the SDS as returned by SDselectargs- OUT: String[3], data information strings: label unit print formatlen- IN: int, max len of string (not needed by Java -- the HDFLibrary interface will handle this)- Returns:
- strings[0] = label, strings[1] = unit, strings[2] = format
- Throws:
HDFException- should be thrown for errors.
-
SDgetdimscale
public static boolean SDgetdimscale(long dimid, byte[] data) throws HDFException- Parameters:
dimid- IN: id of a dimension as returned by SDgetdimiddata- OUT: byte[], data- Returns:
- the the data in the form of a continuous array of bytes.
NOTE: to read into a Java array use the alternative routine below.
- Throws:
HDFException- should be thrown for errors.
-
SDgetdimscale
public static boolean SDgetdimscale(long dimid, java.lang.Object theData) throws HDFException- Parameters:
dimid- IN: id of a dimension as returned by SDgetdimidtheData- OUT: Object, a Java array of appropriate type and size.- Returns:
- the the data in the Java array.
Note: reads the data as bytes and converts to the Java array.
- Throws:
HDFException- should be thrown for errors.
-
SDgetfillvalue
public static boolean SDgetfillvalue(long sdsid, byte[] fillValue) throws HDFException- Parameters:
sdsid- IN: id of the SDS as returned by SDselectfillValue- OUT: byte[], data- Returns:
- the the fill value in the form of a continuous array of bytes.
NOTE: to read into a Java variable use the alternative routine below.
- Throws:
HDFException- should be thrown for errors.
-
SDgetfillvalue
public static boolean SDgetfillvalue(long sdsid, java.lang.Object[] theFillValue) throws HDFException- Parameters:
sdsid- IN: id of the SDS as returned by SDselecttheFillValue- OUT: Object[1], one object of appropriate type- Returns:
- the the data in the Java array: theFillValue[0] = fillValue
Note: the routine calls SDgetinfo to determine the correct type, reads the data as bytes, and converts to the appropriate Java object.
- Throws:
HDFException- should be thrown for errors.
-
SDgetrange
public static boolean SDgetrange(long sdsid, byte[] max, byte[] min) throws HDFException- Parameters:
sdsid- IN: id of the SDS as returned by SDselectmax- OUT: byte[], max value, as bytesmin- OUT: byte[], min value, as bytes- Returns:
- the the max and min values in the form of a continuous array of bytes.
NOTE: to read into Java doubles, use the alternative routine below.
- Throws:
HDFException- should be thrown for errors.
-
SDgetrange
public static boolean SDgetrange(long sdsid, double[] maxmin) throws HDFException- Parameters:
sdsid- IN: id of the SDS as returned by SDselectmaxmin- OUT: double[2], the max and min values converted to doubles- Returns:
- the the data in the Java array: maxmin[0] = max, maxmin[1] = min
Note: the routine calls SDgetinfo to determine the correct type, reads the data as bytes, and converts to the double.
- Throws:
HDFException- should be thrown for errors.
-
SDcreate
public static long SDcreate(long sd_id, java.lang.String name, long number_type, int rank, int[] dimsizes) throws HDFException- Throws:
HDFException
-
SDisrecord
public static boolean SDisrecord(long sdsid) throws HDFException- Throws:
HDFException
-
SDsetattr
public static boolean SDsetattr(long s_id, java.lang.String attr_name, long num_type, int count, byte[] values) throws HDFException- Throws:
HDFException
-
SDsetattr
public static boolean SDsetattr(long s_id, java.lang.String attr_name, long num_type, int count, java.lang.Object theValues) throws HDFException- Throws:
HDFException
-
SDsetcal
public static boolean SDsetcal(long sds_id, double cal, double cal_err, double offset, double offset_err, int number_type) throws HDFException- Throws:
HDFException
-
SDsetdatastrs
public static boolean SDsetdatastrs(long sds_id, java.lang.String label, java.lang.String unit, java.lang.String format, java.lang.String coordsys) throws HDFException- Throws:
HDFException
-
SDsetdimname
public static boolean SDsetdimname(long dim_id, java.lang.String dim_name) throws HDFException- Throws:
HDFException
-
SDsetdimscale
public static boolean SDsetdimscale(long dim_id, int count, int number_type, byte[] data) throws HDFException- Parameters:
dim_id- IN: id of a dimensioncount- IN: number of valuesnumber_type- IN: number type of the valuesdata- IN: byte[], the values, in an array of bytes.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: the calling program must assure that the data is correctly formatted for C. To write an array of Java objects, use the alternative routine below.
-
SDsetdimscale
public static boolean SDsetdimscale(long dim_id, int count, int number_type, java.lang.Object theData) throws HDFException- Parameters:
dim_id- IN: id of a dimensioncount- IN: number of valuesnumber_type- IN: number type of the valuestheData- OUT: Object, a Java array of appropriate type and size.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: converts the Java array to an array of bytes, and writes the bytes.
-
SDsetdimstrs
public static boolean SDsetdimstrs(long dim_id, java.lang.String label, java.lang.String unit, java.lang.String format) throws HDFException- Throws:
HDFException
-
SDsetexternalfile
public static boolean SDsetexternalfile(long sds_id, java.lang.String filename, int offset) throws HDFException- Throws:
HDFException
-
SDsetfillvalue
public static boolean SDsetfillvalue(long sds_id, byte[] fill_val) throws HDFException- Parameters:
sds_id- IN: id of a datasetfill_val- IN: byte[], the fill values in an array of bytes.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: the calling program must assure that the data is correctly formatted for C. To set the fill value with a Java object, use the alternative routine below.
-
SDsetfillvalue
public static boolean SDsetfillvalue(long sds_id, java.lang.Object the_fill_val) throws HDFException- Parameters:
sds_id- IN: id of a datasetthe_fill_val- IN: Object, a Java object of appropriate type- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: converts the Java array to an array of bytes, and writes the bytes.
-
SDsetrange
public static boolean SDsetrange(long sdsid, byte[] max, byte[] min) throws HDFException- Parameters:
sdsid- IN: id of a datasetmax- IN: byte[], the max value in an array of bytesmin- IN: byte[], the min value in an array of bytes- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: the calling program must assure that the data is correctly formatted for C. To set the max and min value with Java objects, use the alternative routine below.
-
SDsetrange
public static boolean SDsetrange(long sdsid, java.lang.Object max, java.lang.Object min) throws HDFException- Parameters:
sdsid- IN: id of a datasetmax- IN: Object, a Java object of appropriate typemin- IN: Object, a Java object of appropriate type- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: converts the Java array to an array of bytes, and writes the bytes.
-
SDwritedata
public static boolean SDwritedata(long sdsid, int[] start, int[] stride, int[] count, byte[] data) throws HDFException- Parameters:
sdsid- IN: the SD interface id, returned by SDselectstart- IN: int[], startstride- IN: int[], stridecount- IN: int[], countdata- IN: byte[], data in an array of bytes- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE: to write from a Java array use the alternative routine below.
-
SDwritedata
public static boolean SDwritedata(long sdsid, int[] start, int[] stride, int[] count, java.lang.Object theData) throws HDFException- Parameters:
sdsid- IN: the SD interface id, returned by SDselectstart- IN: int[], startstride- IN: int[], stridecount- IN: int[], counttheData- IN: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: converts to the Java array to a contiguous array of bytes and then writes to the file.
-
SDsetnbitdataset
public static boolean SDsetnbitdataset(long id, int start_bit, int bit_len, int sign_ext, int fill_one) throws HDFException- Throws:
HDFException
-
SDsetcompress
public static boolean SDsetcompress(long id, int type, HDFCompInfo cinfo) throws HDFException- Parameters:
id- IN: the SD identifier returned by SDselecttype- IN: the type of compressioncinfo- IN: HDFCompInfo, the compression info- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE:The compression algorithm specific information is passed in an appropriate sub-class of HDFCompInfo.
-
SDgetcompinfo
public static boolean SDgetcompinfo(long id, HDFCompInfo cinfo) throws HDFException- Parameters:
id- IN: the SD identifier returned by SDselectcinfo- IN: HDFCompInfo, the compression info- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE:The compression algorithm specific information is passed in an appropriate sub-class of HDFCompInfo.
-
SDsetaccesstype
public static boolean SDsetaccesstype(long id, int accesstype) throws HDFException- Throws:
HDFException
-
SDsetblocksize
public static boolean SDsetblocksize(long sdsid, int block_size) throws HDFException- Throws:
HDFException
-
SDsetfillmode
public static boolean SDsetfillmode(long sdsid, boolean fill_enable) throws HDFException- Parameters:
sdsid- IN: the SD idfill_enable- IN: boolean, true calls library with SD_FILL, false calls library with SD_NOFILL- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.
-
SDsetfillmode
public static boolean SDsetfillmode(long sdsid, int fillmode) throws HDFException- Throws:
HDFException
-
SDsetdimval_comp
public static boolean SDsetdimval_comp(long dimid, int comp_mode) throws HDFException- Throws:
HDFException
-
SDisdimval_bwcomp
public static boolean SDisdimval_bwcomp(long dimid) throws HDFException- Throws:
HDFException
-
SDsetchunk
public static boolean SDsetchunk(long sdsid, HDFChunkInfo chunk_def, int flags) throws HDFException- Parameters:
sdsid- IN: the SD identifier returned by SDselectchunk_def- IN: HDFChunkInfo, the chunking infoflags- IN: the type of chunking- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE:The chunking algorithm-specific information is passed in an appropriate sub-class of HDFChunkInfo.
-
SDgetchunkinfo
public static boolean SDgetchunkinfo(long sdsid, HDFChunkInfo chunk_def, int[] clflags) throws HDFException- Parameters:
sdsid- IN: the SD identifier returned by SDselectchunk_def- OUT: HDFChunkInfo, the chunking infoclflags- OUT: int[1], the type of chunking- Returns:
- c_info contains information about the chunking method, clflags[0] == the chunking flags
NOTE:The chunking algorithm-specific information is passed in an appropriate sub-class of HDFChunkInfo.
- Throws:
HDFException- should be thrown for errors.
-
SDreadchunk
public static boolean SDreadchunk(long sdsid, int[] origin, byte[] theData) throws HDFException- Parameters:
sdsid- IN: the SD interface id, returned by SDselectorigin- IN: int[], origintheData- OUT: byte[], the data in an array of bytes- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE: to read into a Java array use the alternative routine below.
-
SDreadchunk
public static boolean SDreadchunk(long sdsid, int[] origin, java.lang.Object theData) throws HDFException- Parameters:
sdsid- IN: the SD interface id, returned by SDselectorigin- IN: int[], origintheData- IN: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: reads the data as a contiguous array of bytes and then converts it to an appropriate Java object.
-
SDsetchunkcache
public static int SDsetchunkcache(long sdsid, int maxcache, int flags) throws HDFException- Throws:
HDFException
-
SDwritechunk
public static boolean SDwritechunk(long sdsid, int[] origin, byte[] data) throws HDFException- Parameters:
sdsid- IN: the SD interface id, returned by SDselectorigin- IN: int[], origindata- IN: byte[], data to be written, in an array of bytes- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.NOTE: to write from a Java array use the alternative routine below.
-
SDwritechunk
public static boolean SDwritechunk(long sdsid, int[] origin, java.lang.Object theData) throws HDFException- Parameters:
sdsid- IN: the SD interface id, returned by SDselectorigin- IN: int[], origintheData- IN: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors.Note: converts to the Java array to a contiguous array of bytes and then writes to the file.
-
VFfieldesize
public static int VFfieldesize(long vdata_id, int field_index) throws HDFException- Throws:
HDFException
-
VFfieldisize
public static int VFfieldisize(long vdata_id, int field_index) throws HDFException- Throws:
HDFException
-
VFfieldname
public static java.lang.String VFfieldname(long vdata_id, int field_index) throws HDFException- Throws:
HDFException
-
VFfieldorder
public static int VFfieldorder(long vdata_id, int field_index) throws HDFException- Throws:
HDFException
-
VFfieldtype
public static long VFfieldtype(long vdata_id, int field_index) throws HDFException- Throws:
HDFException
-
VFnfields
public static int VFnfields(long vkey) throws HDFException- Throws:
HDFException
-
VHmakegroup
public static int VHmakegroup(long file_id, int[] tag_array, int[] ref_array, int n_objects, java.lang.String vgroup_name, java.lang.String vgroup_class) throws HDFException- Throws:
HDFException
-
VHstoredata
public static int VHstoredata(long file_id, java.lang.String fieldname, byte[] buf, int n_records, int data_type, java.lang.String vdata_name, java.lang.String vdata_class) throws HDFException- Parameters:
file_id- IN: the SD interface id, returned by SDselectfieldname- IN: String, the name of the field to be filledbuf- IN: byte[], data to be written, in an array of bytesn_records- IN: int, the number of records being writtendata_type- IN: int, the number type of the datavdata_name- IN: String, the name of the Vdatavdata_class- IN: String, the class of the Vdata- Returns:
- negative on failure
- Throws:
HDFException- should be thrown for errors.NOTE: to write from a Java array use the alternative routine below.
-
VHstoredata
public static int VHstoredata(long file_id, java.lang.String fieldname, java.lang.Object thebuf, int n_records, int data_type, java.lang.String vdata_name, java.lang.String vdata_class) throws HDFException- Parameters:
file_id- IN: the SD interface id, returned by SDselectfieldname- IN: String, the name of the field to be filledthebuf- IN: Object, data to be written, in a Java array of appropriate type and sizen_records- IN: int, the number of records being writtendata_type- IN: int, the number type of the datavdata_name- IN: String, the name of the Vdatavdata_class- IN: String, the class of the Vdata- Returns:
- negative on failure
- Throws:
HDFException- should be thrown for errors.Note: converts to the Java array to a contiguous array of bytes and then writes to the file.
-
VHstoredatam
public static int VHstoredatam(long file_id, java.lang.String fieldname, byte[] buf, int n_records, int data_type, java.lang.String vdata_name, java.lang.String vdata_class, int order) throws HDFException- Parameters:
file_id- IN: the SD interface id, returned by SDselectfieldname- IN: String, the name of the field to be filledbuf- IN: byte[], data to be written, in an array of bytesn_records- IN: int, the number of records being writtendata_type- IN: int, the number type of the datavdata_name- IN: String, the name of the Vdatavdata_class- IN: String, the class of the Vdataorder- IN: int, the number of components per field- Returns:
- negative on failure
- Throws:
HDFException- should be thrown for errors.NOTE: to write from a Java array use the alternative routine below.
-
VHstoredatam
public static int VHstoredatam(long file_id, java.lang.String fieldname, java.lang.Object buf, int n_records, int data_type, java.lang.String vdata_name, java.lang.String vdata_class, int order) throws HDFException- Parameters:
file_id- IN: the SD interface id, returned by SDselectfieldname- IN: String, the name of the field to be filledbuf- IN: Object, data to be written, in a Java array of appropriate type, dimension, and sizen_records- IN: int, the number of records being writtendata_type- IN: int, the number type of the datavdata_name- IN: String, the name of the Vdatavdata_class- IN: String, the class of the Vdataorder- IN: int, the number of components per field- Returns:
- negative on failure
- Throws:
HDFException- should be thrown for errors.Note: converts to the Java array to a contiguous array of bytes and then writes to the file.
-
VQueryref
public static int VQueryref(long vkey) throws HDFException- Throws:
HDFException
-
VQuerytag
public static int VQuerytag(long vkey) throws HDFException- Throws:
HDFException
-
Vstart
public static boolean Vstart(long fid) throws HDFException- Throws:
HDFException
-
Vattach
public static int Vattach(long fid, int vgroup_ref, java.lang.String access) throws HDFException- Throws:
HDFException
-
Vdetach
public static void Vdetach(long vgroup_id) throws HDFException- Throws:
HDFException
-
Vend
public static void Vend(long file_id) throws HDFException- Throws:
HDFException
-
Vgetid
public static int Vgetid(long file_id, int vgroup_ref) throws HDFException- Throws:
HDFException
-
Vgetclass
public static void Vgetclass(long vgroup_id, java.lang.String[] hdfclassname) throws HDFException- Parameters:
vgroup_id- IN: the Vgroup idhdfclassname- OUT: String[1], the HDF class of the vgroup.- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
Vgetname
public static void Vgetname(long vgroup_id, java.lang.String[] hdfname) throws HDFException- Parameters:
vgroup_id- IN: the Vgroup idhdfname- OUT: String[1], the name of the vgroup.- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
Visvg
public static boolean Visvg(long vgroup_id, int vgroup_ref) throws HDFException- Throws:
HDFException
-
Visvs
public static boolean Visvs(long vgroup_id, int vdata_ref) throws HDFException- Throws:
HDFException
-
Vgettagrefs
public static int Vgettagrefs(long vgroup_id, int[] tags, int[] refs, int arraysize) throws HDFException- Parameters:
vgroup_id- IN: the Vgroup idtags- OUT: int[arraysize], the tagsrefs- OUT: int[arraysize], the refsarraysize- IN: int, the number of tags/refs to return- Returns:
- tags[] = tags for objects 0 - n, refs[] = refs for objects 0 - n
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
Vgettagref
public static boolean Vgettagref(long vgroup_id, int index, int[] tagref) throws HDFException- Parameters:
vgroup_id- - IN: the Vgroup idindex- - IN: the index of the objecttagref- - OUT: tagref[0]=tag, tagref[1]=ref- Returns:
- tags[0] = tag for object #index, refs[0] = ref for objects #index
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
Vntagrefs
public static int Vntagrefs(long vgroup_id) throws HDFException- Throws:
HDFException
-
Vinqtagref
public static boolean Vinqtagref(long vgroup_id, int tag, int ref) throws HDFException- Throws:
HDFException
-
Vlone
public static int Vlone(long fid, int[] ref_array, int buffersize) throws HDFException- Parameters:
fid- IN: the file identifier returned by Hopenref_array- OUT: int[], the refs for Vdata not part of Vgroupsbuffersize- IN: the max size of the ref_array- Returns:
- ref_array[] = refs 0 - ...
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
Vaddtagref
public static int Vaddtagref(long vgroup_id, int tag, int ref) throws HDFException- Throws:
HDFException
-
Vdeletetagref
public static int Vdeletetagref(long vgroup_id, int tag, int ref) throws HDFException- Throws:
HDFException
-
Vfind
public static int Vfind(long file_id, java.lang.String vgroup_name) throws HDFException- Throws:
HDFException
-
Vfindclass
public static int Vfindclass(long file_id, java.lang.String vgclassname) throws HDFException- Throws:
HDFException
-
Vflocate
public static int Vflocate(int key, java.lang.String vgclassname) throws HDFException- Throws:
HDFException
-
Vgetnext
public static int Vgetnext(int key, int ref) throws HDFException- Throws:
HDFException
-
Vinquire
public static boolean Vinquire(long vgroup_id, int[] n_entries, java.lang.String[] vgroup_name) throws HDFException- Parameters:
vgroup_id- IN: the Vgroup idn_entries- OUT: int[1], the number of objects in the Vgroupvgroup_name- OUT: String[1], the name of the Vgroup- Returns:
- n_entries[0] = number of entries, vgroup_name[0] = the name
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
Vinsert
public static int Vinsert(long vgroup_id, long v_id) throws HDFException- Throws:
HDFException
-
Vnrefs
public static int Vnrefs(int key, int ref) throws HDFException- Throws:
HDFException
-
Vsetclass
public static boolean Vsetclass(long vgroup_id, java.lang.String vgclassname) throws HDFException- Throws:
HDFException
-
Vsetname
public static boolean Vsetname(long vgroup_id, java.lang.String vgname) throws HDFException- Throws:
HDFException
-
Vattrinfo
public static boolean Vattrinfo(long id, int index, java.lang.String[] name, int[] argv) throws HDFException- Parameters:
id- IN: Vgroup identifier returned by Vattachindex- IN: the index of the attributename- OUT: String[1], the name of the attributeargv- OUT: int[5], Data type of the target attribute, Number of values in the target attribute, Size, in bytes, of the values of the target attribute, ,- Returns:
- name[0] = name, argv[0] = data_type, argv[1] = count, argv[2] = size, argv[3] = nfields, argv[4] = refnum
- Throws:
HDFException- thrown for errors in the HDF library call.
-
Vfindattr
public static long Vfindattr(long id, java.lang.String name) throws HDFException- Throws:
HDFException
-
Vgetattr
public static boolean Vgetattr(long id, int index, byte[] data) throws HDFException- Parameters:
id- IN: the Vdata idindex- IN: the index of the attributedata- OUT: byte[], the data in an array of bytes- Returns:
- data = the value of the attribute, in an array of bytes
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to read into a Java array use the alternative routine below.
-
Vgetattr
public static boolean Vgetattr(long id, int index, java.lang.Object theData) throws HDFException- Parameters:
id- IN: the Vdata idindex- IN: the index of the attributetheData- OUT: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- data = the value of the attribute, in an array of Java objects
- Throws:
HDFException- should be thrown for errors in the HDF library call.Note: reads the data as a contiguous array of bytes and then converts it to an appropriate Java object.
-
Vgetversion
public static int Vgetversion(long id) throws HDFException- Throws:
HDFException
-
Vnattrs
public static int Vnattrs(long id) throws HDFException- Throws:
HDFException
-
Vsetattr
public static boolean Vsetattr(long id, java.lang.String attr_name, long data_type, int count, java.lang.String values) throws HDFException- Throws:
HDFException
-
Vsetattr
public static boolean Vsetattr(long id, java.lang.String attr_name, long data_type, int count, byte[] data) throws HDFException- Parameters:
id- IN: the Vdata idattr_name- IN: String, the name of the attributedata_type- IN: int, the number_type of the attributecount- IN: the number of valuesdata- IN: byte[], the data in an array of bytes- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to write into a Java array use the alternative routine below.
-
Vsetattr
public static boolean Vsetattr(long id, java.lang.String attr_name, long data_type, int count, java.lang.Object theData) throws HDFException- Parameters:
id- IN: the Vdata idattr_name- IN: String, the name of the attributedata_type- IN: int, the number_type of the attributecount- IN: the number of valuestheData- IN: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.Note: converts the data to a contiguous array of bytes and then converts writes it.
-
VSQuerycount
public static boolean VSQuerycount(long vdata_id, int[] n_records) throws HDFException- Parameters:
vdata_id- IN, vdata id as returned by VSattachn_records- OUT, int[1], the number of records in the vdata- Returns:
- n_records[0] == the number of records
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSQueryfields
public static boolean VSQueryfields(long vdata_id, java.lang.String[] fields) throws HDFException- Parameters:
vdata_id- IN, vdata id as returned by VSattachfields- OUT, String[1], the names of the fields- Returns:
- fields[0] == a comma delimited string with the names of the fields.
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSQueryinterlace
public static boolean VSQueryinterlace(long vdata_id, int[] interlace) throws HDFException- Parameters:
vdata_id- IN, vdata id as returned by VSattachinterlace- OUT, int[1], the interlace mode,- Returns:
- interlace[0] == the number of records, HDFConstants.FULL_INTERLACE or HDFConstants.NO_INTERLACE
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSQueryname
public static boolean VSQueryname(long vdata_id, java.lang.String[] vdata_name) throws HDFException- Parameters:
vdata_id- IN, vdata id as returned by VSattachvdata_name- OUT, String[1], the name of the vdata- Returns:
- vdata_name[0] == the name
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSQueryref
public static int VSQueryref(long vdata_id) throws HDFException- Throws:
HDFException
-
VSQuerytag
public static int VSQuerytag(long vdata_id) throws HDFException- Throws:
HDFException
-
VSQueryvsize
public static boolean VSQueryvsize(long vdata_id, int[] vdata_size) throws HDFException- Parameters:
vdata_id- IN, vdata id as returned by VSattachvdata_size- OUT, int[1], the size of the vdata- Returns:
- vdata_size[0] == Native size, in bytes, of a record in the vdata
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSattach
public static int VSattach(long fid, int vdata_ref, java.lang.String access) throws HDFException- Throws:
HDFException
-
VSdetach
public static void VSdetach(long vdata_id) throws HDFException- Throws:
HDFException
-
VSgetid
public static long VSgetid(long file_id, int vdata_ref) throws HDFException- Throws:
HDFException
-
VSgetclass
public static void VSgetclass(long vdata_id, java.lang.String[] hdfclassname) throws HDFException- Parameters:
vdata_id- IN, vdata id as returned by VSattachhdfclassname- OUT, String[1], the class name of the vdata- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSgetname
public static void VSgetname(long vdata_id, java.lang.String[] hdfname) throws HDFException- Parameters:
vdata_id- IN, vdata id as returned by VSattachhdfname- OUT, String[1], the name of the vdata- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSelts
public static int VSelts(long vdata_id) throws HDFException- Throws:
HDFException
-
VSfdefine
public static boolean VSfdefine(long vdata_id, java.lang.String fieldname, int numbertype, int order) throws HDFException- Throws:
HDFException
-
VSfexist
public static boolean VSfexist(long vdata_id, java.lang.String fields) throws HDFException- Throws:
HDFException
-
VSfind
public static int VSfind(long file_id, java.lang.String vdataname) throws HDFException- Throws:
HDFException
-
VSsetblocksize
public static int VSsetblocksize(long vdata_id, int blocksize) throws HDFException- Throws:
HDFException
-
VSsetnumblocks
public static int VSsetnumblocks(long vdata_id, int numblocks) throws HDFException- Throws:
HDFException
-
VSgetfields
public static int VSgetfields(long vdata_id, java.lang.String[] fieldname) throws HDFException- Parameters:
vdata_id- IN, vdata id as returned by VSattachfieldname- OUT, String[1], the names of the fields- Returns:
- fieldname[0] == a comma delimited string with the names of the fields.
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSgetinterlace
public static int VSgetinterlace(long vdata_id) throws HDFException- Throws:
HDFException
-
VSinquire
public static boolean VSinquire(long vdata_id, int[] iargs, java.lang.String[] sargs) throws HDFException- Parameters:
vdata_id- IN, vdata id as returned by VSattachiargs- OUT, int[3], n_records, interlace, vdata_sizesargs- OUT, String[2], names the dataset, fields- Returns:
- iargs[0] = n_records, iargs[1] = interlace, iargs[2] = vdata_size, sargs[0] = vdata_name,
sargs[1] = comma delimited list of fields
NOTE: the parameters for the Java interface are not in the same order as the C interface.
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSinquire
public static boolean VSinquire(long vdata_id, int[] iargs) throws HDFException- Parameters:
vdata_id- IN, vdata id as returned by VSattachiargs- OUT, int[2], block_size, num_blocks- Returns:
- iargs[0] = blocksize, iargs[1] = num_blocks
NOTE: the parameters for the Java interface are not in the same order as the C interface.
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSlone
public static int VSlone(long fid, int[] ref_array, int buffersize) throws HDFException- Parameters:
fid- IN, File identifier returned by Hopenref_array- OUT, int[?], the refsbuffersize- IN, int, the max number of refs to return.- Returns:
- ref_array contains refs. The Java API ignores the buffersize argument, returns as many as possible.
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSread
public static int VSread(long vdata_id, byte[] databuf, int nrecord, int interlace) throws HDFException- Parameters:
vdata_id- IN: the Vdata iddatabuf- OUT: byte[], the data in an array of bytesnrecord- IN: int, number of recordsinterlace- IN: int, interlace- Returns:
- the number of elements read (0 or a +ve integer)
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to read into a Java array use the alternative routine below.
-
VSread
public static int VSread(long vdata_id, java.lang.Object theData, int nrecord, int interlace) throws HDFException- Parameters:
vdata_id- IN: the Vdata idtheData- OUT: Object, a Java array of appropriate type, dimensions, and size.nrecord- IN: int, number of recordsinterlace- IN: int, interlace- Returns:
- the number of elements read (0 or a +ve integer)
- Throws:
HDFException- should be thrown for errors in the HDF library call.Note: reads the data as a contiguous array of bytes and then converts it to an appropriate Java object.
-
VSseek
public static int VSseek(long vdata_id, int record) throws HDFException- Throws:
HDFException
-
VSsetfields
public static boolean VSsetfields(long vdata_id, java.lang.String fields) throws HDFException- Throws:
HDFException
-
VSsetinterlace
public static boolean VSsetinterlace(long vdata_id, int interlace) throws HDFException- Throws:
HDFException
-
VSsizeof
public static int VSsizeof(long vdata_id, java.lang.String fields) throws HDFException- Throws:
HDFException
-
VSappendable
public static boolean VSappendable(int vkey, int block_size) throws HDFException- Throws:
HDFException
-
VSfindclass
public static int VSfindclass(long file_id, java.lang.String vgclass) throws HDFException- Throws:
HDFException
-
VSgetversion
public static int VSgetversion(int vkey) throws HDFException- Throws:
HDFException
-
VSsetclass
public static void VSsetclass(long vdata_id, java.lang.String vdata_class) throws HDFException- Throws:
HDFException
-
VSsetexternalfile
public static boolean VSsetexternalfile(int vkey, java.lang.String filename, int offset) throws HDFException- Throws:
HDFException
-
VSsetname
public static void VSsetname(long vdata_id, java.lang.String vdata_name) throws HDFException- Throws:
HDFException
-
VSwrite
public static int VSwrite(long vdata_id, byte[] databuf, int n_records, int interlace) throws HDFException- Parameters:
vdata_id- IN: the Vdata iddatabuf- IN: byte[], the data in an array of bytesn_records- IN: int, number of recordsinterlace- IN: int, interlace- Returns:
- the number of elements written (0 or a +ve integer)
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to write a Java array use the alternative routine below.
-
VSwrite
public static int VSwrite(long vdata_id, java.lang.Object databuf, int n_records, int interlace) throws HDFException- Parameters:
vdata_id- IN: the Vdata iddatabuf- IN: Object, a Java array of appropriate type, dimensions, and size.n_records- IN: int, number of recordsinterlace- IN: int, interlace- Returns:
- the number of elements written (0 or a +ve integer)
- Throws:
HDFException- should be thrown for errors in the HDF library call.Important Note: This interface only supports records which are all of the same numeric type, with no character fields. Heterogeneous fields can be written as bytes (see above), but the calling program must make sure the data is in proper order to write to the HDF library.
Note: converts the data into a contiguous array of bytes and then writes it
-
VSattrinfo
public static boolean VSattrinfo(long id, int index, int attr_index, java.lang.String[] name, int[] argv) throws HDFException- Parameters:
id- IN: the Vdata idindex- IN: int, the index of the attributeattr_index- IN: int, the index of the attributename- OUT: String[1], the name of the attributeargv- OUT: int[3], Data type of the target attribute, Number of values in the target attribute, Size, in bytes, of the values of the target attribute,- Returns:
- name[0] = name, argv[0] = data_type, argv[1] = count, argv[2] = size
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSfindex
public static int VSfindex(long id, java.lang.String name, int[] findex) throws HDFException- Parameters:
id- IN: the Vdata idname- IN: the name of the attributefindex- IN: int[1], the index of the attribute- Returns:
- findex[0] = the index
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
VSfindattr
public static int VSfindattr(long id, int index, java.lang.String name) throws HDFException- Throws:
HDFException
-
VSfnattrs
public static int VSfnattrs(long id, int fnattrs) throws HDFException- Throws:
HDFException
-
VSgetattr
public static boolean VSgetattr(long id, int index, int attr_index, byte[] data) throws HDFException- Parameters:
id- IN: the Vdata idindex- IN: the index of the vdataattr_index- IN: the index of the attributedata- OUT: byte[], the data in an array of bytes- Returns:
- data = the value of the attribute, in an array of bytes
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to read into a Java array use the alternative routine below.
-
VSgetattr
public static boolean VSgetattr(long id, int index, int attr_index, java.lang.Object theData) throws HDFException- Parameters:
id- IN: the Vdata idindex- IN: the index of the vdataattr_index- IN: the index of the attributetheData- OUT: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- data = the value of the attribute, in an array of Java objects
- Throws:
HDFException- should be thrown for errors in the HDF library call.Note: reads the data as a contiguous array of bytes and then converts it to an appropriate Java object.
-
VSisattr
public static boolean VSisattr(long id) throws HDFException- Throws:
HDFException
-
VSnattrs
public static int VSnattrs(long id) throws HDFException- Throws:
HDFException
-
VSsetattr
public static boolean VSsetattr(long id, int index, java.lang.String attr_name, long data_type, int count, java.lang.String values) throws HDFException- Parameters:
id- IN: the Vdata idindex- IN: the index of the vdataattr_name- IN: String, the name of the attributedata_type- IN: int, the number_type of the attributecount- IN: the number of valuesvalues- IN: String, the data in an String- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to write from a Java array use the alternative routine below.
-
VSsetattr
public static boolean VSsetattr(long id, int index, java.lang.String attr_name, long data_type, int count, byte[] values) throws HDFException- Parameters:
id- IN: the Vdata idindex- IN: the index of the vdataattr_name- IN: String, the name of the attributedata_type- IN: int, the number_type of the attributecount- IN: the number of valuesvalues- IN: byte[], the data in an array of bytes- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to write into a Java array use the alternative routine below.
-
VSsetattr
public static boolean VSsetattr(long id, int index, java.lang.String attr_name, long data_type, int count, java.lang.Object theData) throws HDFException- Parameters:
id- IN: the Vdata idindex- IN: the index of the vdataattr_name- IN: String, the name of the attributedata_type- IN: int, the number_type of the attributecount- IN: the number of valuestheData- IN: Object, a Java array of appropriate type, dimensions, and size.- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.Note: converts the data to a contiguous array of bytes and then converts writes it.
-
DF24getdims
public static boolean DF24getdims(java.lang.String fileName, int[] argv) throws HDFException- Parameters:
fileName- IN: String, the fileargv- OUT: int[3], the width, height, and interlace mode- Returns:
- argv[0] = width, argv[1] = height, argv[2] = interlace
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
DF24reqil
public static boolean DF24reqil(int il) throws HDFException- Throws:
HDFException
-
DF24getimage
public static boolean DF24getimage(java.lang.String fileName, byte[] imagedata, int width, int height) throws HDFException- Parameters:
fileName- IN: String, the fileimagedata- OUT: byte[], the image, in an array of byteswidth- IN: int, the width of the imageheight- IN: int, the height of the image- Returns:
- data = the image in an array of bytes
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to read into a Java array use the alternative routine below.
-
DF24getimage
public static boolean DF24getimage(java.lang.String fileName, java.lang.Object theImagedata, int width, int height) throws HDFException- Parameters:
fileName- IN: String, the filetheImagedata- OUT: Object, the image, in a java array of appropriate size and typewidth- IN: int, the width of the imageheight- IN: int, the height of the image- Returns:
- data = the value of the attribute, in an array of Java objects
- Throws:
HDFException- should be thrown for errors in the HDF library call.Note: reads the data as a contiguous array of bytes and then converts it to an appropriate Java object.
-
DF24lastref
public static short DF24lastref() throws HDFException- Throws:
HDFException
-
DF24restart
public static boolean DF24restart() throws HDFException- Throws:
HDFException
-
DF24readref
public static boolean DF24readref(java.lang.String filename, int ref) throws HDFException- Throws:
HDFException
-
DF24nimages
public static int DF24nimages(java.lang.String fileName) throws HDFException- Throws:
HDFException
-
DF24addimage
public static boolean DF24addimage(java.lang.String filename, byte[] image, int width, int height) throws HDFException- Parameters:
filename- IN: String, the fileimage- IN: byte[], the image, in an array of byteswidth- IN: int, the width of the imageheight- IN: int, the height of the image- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to write from a Java array use the alternative routine below.
-
DF24addimage
public static boolean DF24addimage(java.lang.String filename, java.lang.Object theImage, int width, int height) throws HDFException- Parameters:
filename- IN: String, the filetheImage- IN: Object, the image, in a java array of appropriate size and typewidth- IN: int, the width of the imageheight- IN: int, the height of the image- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.Note: converts the data into a contiguous array of bytes and then writes it to the file
-
DF24putimage
public static boolean DF24putimage(java.lang.String filename, byte[] image, int width, int height) throws HDFException- Parameters:
filename- IN: String, the fileimage- IN: byte[], the image, in an array of byteswidth- IN: int, the width of the imageheight- IN: int, the height of the image- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to write from a Java array use the alternative routine below.
-
DF24putimage
public static boolean DF24putimage(java.lang.String filename, java.lang.Object theImage, int width, int height) throws HDFException- Parameters:
filename- IN: String, the filetheImage- IN: Object, the image, in a java array of appropriate size and typewidth- IN: int, the width of the imageheight- IN: int, the height of the image- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.Note: converts the data into a contiguous array of bytes and then writes it to the file
-
DF24setcompress
public static boolean DF24setcompress(int type, HDFCompInfo cinfo) throws HDFException- Parameters:
type- IN: int, the type of compressioncinfo- IN: HDFCompInfo, the compression parameters- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
DF24setdims
public static boolean DF24setdims(int width, int height) throws HDFException- Throws:
HDFException
-
DF24setil
public static boolean DF24setil(int il) throws HDFException- Throws:
HDFException
-
DFR8getdims
public static boolean DFR8getdims(java.lang.String fileName, int[] argv, boolean[] haspalette) throws HDFException- Parameters:
fileName- IN: String, the fileargv- OUT: int[2], the width and heighthaspalette- OUT: boolean[1], has a palette- Returns:
- argv[0] = width, argv[1] = height, haspalette[0] = palette
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
DFR8getimage
public static boolean DFR8getimage(java.lang.String fileName, byte[] imagedata, int width, int height, byte[] palette) throws HDFException- Parameters:
fileName- IN: String, the fileimagedata- OUT: byte[], the image, in an array of byteswidth- IN: int, the width of the imageheight- IN: int, the height of the imagepalette- OUT: byte[], the color look up table- Returns:
- data = imagedata: the image in an array of bytes, palette: the look up table, in an array of bytes
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to read into a Java array use the alternative routine below.
-
DFR8getimage
public static boolean DFR8getimage(java.lang.String fileName, java.lang.Object theImagedata, int width, int height, byte[] palette) throws HDFException- Parameters:
fileName- IN: String, the filetheImagedata- OUT: Object, the image, in a java array of appropriate size and typewidth- IN: int, the width of the imageheight- IN: int, the height of the imagepalette- OUT: byte[], the color look up table- Returns:
- data = theImagedata: the value of the attribute, in an array of Java objects palette: the look up table, in an array of bytes
- Throws:
HDFException- should be thrown for errors in the HDF library call.Note: reads the data as a contiguous array of bytes and then converts it to an appropriate Java object.
-
DFR8lastref
public static short DFR8lastref() throws HDFException- Throws:
HDFException
-
DFR8restart
public static boolean DFR8restart() throws HDFException- Throws:
HDFException
-
DFR8readref
public static boolean DFR8readref(java.lang.String filename, int ref) throws HDFException- Throws:
HDFException
-
DFR8nimages
public static int DFR8nimages(java.lang.String fileName) throws HDFException- Throws:
HDFException
-
DFR8addimage
public static boolean DFR8addimage(java.lang.String filename, byte[] image, int width, int height, short compress) throws HDFException- Parameters:
filename- IN: String, the fileimage- IN: byte[], the image, in an array of byteswidth- IN: int, the width of the imageheight- IN: int, the height of the imagecompress- IN: short, the type of compression- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to write from a Java array use the alternative routine below.
-
DFR8addimage
public static boolean DFR8addimage(java.lang.String filename, java.lang.Object theImage, int width, int height, short compress) throws HDFException- Parameters:
filename- IN: String, the filetheImage- IN: Object, the image, in a java array of appropriate size and typewidth- IN: int, the width of the imageheight- IN: int, the height of the imagecompress- IN: short, the type of compression- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.Note: converts the data into a contiguous array of bytes and then writes it to the file
-
DFR8putimage
public static boolean DFR8putimage(java.lang.String filename, byte[] image, int width, int height, short compress) throws HDFException- Parameters:
filename- IN: String, the fileimage- IN: byte[], the image, in an array of byteswidth- IN: int, the width of the imageheight- IN: int, the height of the imagecompress- IN: short, the type of compression- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.NOTE: to write from a Java array use the alternative routine below.
-
DFR8putimage
public static boolean DFR8putimage(java.lang.String filename, java.lang.Object theImage, int width, int height, short compress) throws HDFException- Parameters:
filename- IN: String, the filetheImage- IN: Object, the image, in a java array of appropriate size and typewidth- IN: int, the width of the imageheight- IN: int, the height of the imagecompress- IN: short, the type of compression- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.Note: converts the data into a contiguous array of bytes and then writes it to the file
-
DFR8setcompress
public static boolean DFR8setcompress(int type, HDFCompInfo cinfo) throws HDFExceptionDFR8setcompress sets compression scheme for 8-bit image- Parameters:
type- IN: int, the type of compressioncinfo- IN: HDFCompInfo, the compression parameters- Returns:
- true on success
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
DFR8getpalref
public static boolean DFR8getpalref(short[] palref) throws HDFException- Parameters:
palref- OUT: short[1], the HDF ref of the palette- Returns:
- palref[0] = the ref of the palette
- Throws:
HDFException- should be thrown for errors in the HDF library call.
-
DFR8setpalette
public static boolean DFR8setpalette(byte[] palette) throws HDFException- Throws:
HDFException
-
DFR8writeref
public static boolean DFR8writeref(java.lang.String filename, short ref) throws HDFException- Throws:
HDFException
-
HCget_config_info
public static int HCget_config_info(int coder_type) throws HDFExceptionNew API for hdf-42r1- Parameters:
coder_type- comp_coder_t enum for determining which type of encoding is being done- Returns:
- the compression config info value
- Throws:
HDFException- thrown for errors in the HDF library call.
-
-