Page tree

 

JAVA

FORTRAN

C++

C

 

Link

H5T_ENCODE

Encode a datatype object description into a binary buffer.

Procedure:

H5T_ENCODE(obj_id, buf, nalloc)

Signature:

herr_t H5Tencode(hid_t obj_id, unsigned char *buf, size_t *nalloc)

SUBROUTINE h5tencode_f(obj_id, buf, nalloc, hdferr)
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded
  CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer object to be encoded into
  INTEGER(SIZE_T), INTENT(INOUT) :: nalloc 
                                       ! The size of the allocated buffer
  INTEGER, INTENT(OUT) :: hdferr       ! Error code
                                       ! 0 on success and -1 on failure
END SUBROUTINE h5tencode_f

Parameters:
hid_t obj_idIN: Identifier of the object to be encoded.
unsigned char *buf    IN/OUT: Buffer for the object to be encoded into. If the provided buffer is NULL, only the size of buffer needed is returned through nalloc.
size_t *nallocIN: The size of the allocated buffer. 
OUT: The size of the buffer needed.

Description:

Given datatype identifier, H5Tencode converts a data type description into binary form in a buffer. Using this binary form in the buffer, a datatype object can be reconstructed using H5Tdecode to return a new object handle (hid_t) for this datatype.

A preliminary H5Tencode call can be made to find out the size of the buffer needed. This value is returned as nalloc. That value can then be assigned to nalloc for a second H5Tencode call, which will retrieve the actual encoded object.

If the library finds out nalloc is not big enough for the object, it simply returns the size of the buffer needed through nallocwithout encoding the provided buffer.

Returns:

Returns a non-negative value if successful; otherwise returns a negative value.

Example:

Coming Soon!

--- Last Modified: December 04, 2017 | 06:57 AM