Class ObservableInputStream

All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
MessageDigestCalculatingInputStream, MessageDigestInputStream

The ObservableInputStream allows, that an InputStream may be consumed by other receivers, apart from the thread, which is reading it. The other consumers are implemented as instances of ObservableInputStream.Observer.

A typical application may be the generation of a MessageDigest on the fly.

Note: The ObservableInputStream is not thread safe, as instances of InputStream usually aren't. If you must access the stream from multiple threads, then synchronization, locking, or a similar means must be used.

See Also: