JasPer  3.0.4
I/O Streams

API References

I/O Streams

The library provides a type for representing a stream of characters for input/output. Such a stream is represented by the type jas_stream_t. Streams (in the JasPer library) are similar to I/O streams in the C standard library but have a few additional functionalities. In particular, with JasPer I/O streams, it is possible to:

  • set a limit on the number of characters that can be read from or written to a stream;
  • put back more than one character read from a stream;
  • query the number of characters that have been read from or written to a stream; and
  • associate a stream with one of several different types of underlying data sources/sinks (including buffers in memory and temporary files).

The possible underlying sources/sinks for a stream include:

  • a stdio stream (i.e., FILE)
  • a file descriptor
  • a memory buffer
  • a temporary file

The following functions are used for opening/closing streams:

The following functions are used for reading/writing streams:

The following functions are used for getting/setting the position within a stream:

Numerous other functions for streams are also provided, including: