[Top]
[Prev]
[Next]
[Bottom]
Hread
int32 Hread(int32
h_id
, int32
length
, VOIDP
data
)
h_id
IN:
Access identifier returned by
Hstartread
,
Hstartwrite
, or
Hnextread
length
IN:
Length of segment to be read
data
OUT:
Pointer to the data array to be read
Purpose
Reads the next segment in a data element.
Return value
Returns the length of segment actually read if successful and FAIL (or -1) otherwise.
Description
Hread
begins reading at the current file position, reads the specified number of bytes, and increments the current file position by one. Calling
Hread
with the
length
= 0 reads the entire data element. To reposition an access identifier before writing data, use
Hseek
.
If
length
is longer than the data element, the read operation is terminated at the end of the data element, and the number of read bytes is returned. Although only one access identifier is allowed per data element, it is possible to interlace reads from multiple data elements in the same file. It is assumed that data is large enough to hold the specified data length.
[Top]
[Prev]
[Next]
[Bottom]
hdfhelp@ncsa.uiuc.edu
HDF User's Reference Manual, Draft 06/09/97, NCSA HDF Development Group.