Class 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.