Rob Spoor wrote:TeePrintWriter (or TeePrintStream, in case you have it as well) shouldn't be necessary. Just wrap a TeeWriter / TeeOutputStream in a new PrintWriter (or PrintStream).
Indeed. I wrote these classes about a decade ago such that they all took as arguments two streams of the same basic type. With the introduction of varags I converted the TeeOutputStream so that it now takes a varags list of OutputStreams but I didn't bother updating the other Tee streams as I rarely use them.
One of the advantages of using the varags TeeOutputStream is that it immediately got rid of my need for an OutputStream to discard all input (I use that in some
JUnit tests when checking for exceptions). I just have to give it nothing to chain to.