Access to a stream (Server)

The DataBlade® API provides a stream I/O interface, which enables you to use the same function calls to access different objects. Stream is a generic term for an object that can be written to or read from.

A stream has the following information associated with it:
  • The stream data, to which the stream provides access
  • The stream seek position, which identifies where the next read or write operation starts in the stream

    When you first open a stream, its seek position is at byte zero.

  • The stream descriptor, which contains information about the stream
To provide access to a stream from within a C UDR, the DataBlade API has the MI_STREAM data type structure for stream descriptors. An MI_STREAM structure contains information about a stream on a particular object. The following table summarizes the memory operations for a stream descriptor.
Memory duration Memory operation Function name
Current® memory duration Constructor mi_stream_open_fio(), mi_stream_open_mi_lvarchar(), mi_stream_open_str()

Other, user-defined stream-open functions

Current memory duration Destructor mi_stream_close()