Package sop.util

Class ProxyOutputStream

java.lang.Object
java.io.OutputStream
sop.util.ProxyOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class ProxyOutputStream extends OutputStream
OutputStream that buffers data being written into it, until its underlying output stream is being replaced. At that point, first all the buffered data is being written to the underlying stream, followed by any successive data that may get written to the ProxyOutputStream.

This class is useful if we need to provide an OutputStream at one point in time when the final target output stream is not yet known.