You are here: The Support Classes > Streams

Streams

The MrSID SDK provides an abstract stream class, LTIOStreamInf, which provides a Unix stdio-like interface for working with data in files or file-like objects. Rather than relying on the application to provide a file name or a FILE*, many of the SDK functions are designed to operate on LTIOStreamInf objects instead. This enables more portable and extensible interfaces.

The LTIOStreamInf interface requires only a small set of primitives, including:

(For details on the precise semantics of these primitives, see the Reference Manual and "Notes on Streams".)

A number of useful stream types, including files, in-memory buffers, sockets, and buffered streams, can be implemented using the stream interface. The SDK provides the following stream implementations:

Examples

The Reference Manual contains several examples of working with streams, including code showing how to perform simple reads and writes and how to derive your own simple stream from LTIOStreamInf.