Streams are Object Orientated.
- • Each class of Stream has its own operations structure.
- • It defines the methods that can be called for that class of stream
- • Each instance of a given class share the same operations structure.
- • Each instance has its own abstract data pointer to hold instance
specific data (such as the underlying file/resource handles).
To implement your own stream you need to define an operations structure and
the methods that apply to your stream. The core methods are:
- • write() - write data to the stream
- • read() - read data from the stream
- • close() - shutdown/release the stream
- • flush() - ensure data is flushed to storage
- • seek() - move to an offset within the stream