Class TeeOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    public class TeeOutputStream
    extends FilterOutputStream
    Class to copy a stream to another stream or file as it is being sent through a stream pipe E.g.
        PrintWriter r = new PrintWriter(new TeeOutputStream(new FileOutputStream("file"), new File("otherfile")));