Is it possible (using the standard java.nio api, without major hacking or proxying or facading) to take an output stream, and clone it, so that every write to the stream gets copied to two, independent output streams from one ?
Is it possible (using the standard java.nio api, without major hacking or proxying or
Share
No. You would have to write an implementation of
WritableByteChannelthat delegated to both (all) target channels. Not too difficult, only one constructor and three methods to write.EDIT You can do the same thing for streams by writing a FilterOutputStream derived class. Again very easy.