Class ConsumingInputStream

java.lang.Object
java.io.InputStream
no.digipost.io.ConsumingInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class ConsumingInputStream extends InputStream
An InputStream getting its contents from consuming an OutputStream. The InputStream will be immediately available for reading after construction, regardless of how much data that will be produced by the OutputStream. This class abstracts the use of a PipedInputStream and a PipedOutputStream, hiding the complexities required to orchestrate this multithreaded combination of streams.