Logo Search packages:      
Sourcecode: jhdf version File versions  Download package

static synchronized int ncsa::hdf::hdf5lib::H5::H5Aread ( int  attr_id,
int  mem_type_id,
Object  obj 
) throws HDF5Exception, NullPointerException [inline, static]

H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with mem_type_id. The entire attribute is read into data object from the file.

Parameters:
attr_id IN: Identifier of an attribute to read.
mem_type_id IN: Identifier of the attribute datatype (in memory).
obj IN: Object for data to be read.
Returns:
a non-negative value if successful
Exceptions:
HDF5LibraryException - Error from the HDF-5 Library.
NullPointerException - data buffer is null. See public synchronized static native int H5Aread( )

Definition at line 593 of file H5.java.

References ncsa::hdf::hdf5lib::HDFArray::arrayify(), ncsa::hdf::hdf5lib::HDFArray::emptyBytes(), and H5Aread().

    {
        HDFArray theArray = new HDFArray(obj);
        byte[] buf = theArray.emptyBytes();

        //  This will raise an exception if there is an error
        int status = H5Aread(attr_id, mem_type_id, buf);

        // No exception:  status really ought to be OK
        if (status >= 0) {
            obj = theArray.arrayify( buf);
        }

        return status;
    }


Generated by  Doxygen 1.6.0   Back to index