The mi_streamread_int8() function

The mi_streamread_int8() function reads an mi_int8 (INT8) value from a stream, converting any difference in the stream representation to that of the internal representation.

Syntax

mi_integer mi_streamread_int8(strm_desc, int8_dptr)
   MI_STREAM *strm_desc;
   mi_int8 **int8_dptr;
strm_desc
A pointer to the stream descriptor for the open stream from which to read the mi_int8 value.
int8_dptr
A pointer to the buffer into which to copy the address of the mi_int8 value.
Valid in client LIBMI application? Valid in user-defined routine?
No Yes

Usage

The mi_streamread_int8() function reads an mi_int8 value from the stream that strm_desc references. The function reads the mi_int8 value from the stream and puts the address of the value in the buffer that *int8_dptr references. The read operation begins at the current stream seek position. You can use mi_stream_tell() or mi_stream_getpos() to obtain this seek position.

When *int8_dptr points to NULL, mi_streamread_int8() allocates the memory for the buffer in the current memory duration. Otherwise, the function assumes that you have allocated the memory that *int8_dptr references.
Important: Be sure that *int8_dptr points to NULL if the parameter does not point to valid memory.

The mi_streamread_int8() function is useful in a streamread() support function of an opaque data type that contains an mi_int8 value.

For more information about the use of mi_streamread_int8() in a streamread() support function, see the HCL OneDB™ DataBlade® API Programmer's Guide.

Return values

>=0
The number of bytes that the function has read from the open stream to the value that int8_dptr references.
MI_STREAM_EEOF
The end of the stream has been reached without any errors.
MI_STREAM_EBADARG
The stream descriptor that strm_desc references or the value that int8_dptr references is invalid.
MI_ERROR
The function was not successful.