public class MultiplexingOutputStream extends OutputStream
OutputStream that allows to multiplex everything that
is written to it to all contained output streams (multiplexing).
This is not optimized for performance (by supporting batch writes) but just minimal code by now.
| 构造器和说明 |
|---|
MultiplexingOutputStream(OutputStream streamOne,
OutputStream streamTwo)
Constructor ensuring that at least two targets are needed (thus use of this
class makes sense).
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addOutputStream(OutputStream delegate)
Adds the given output stream to the list of delegates multiplexed to.
|
boolean |
removeOutputStream(OutputStream delegate)
Removes the given output stream from the list of delegates multiplexed to.
|
void |
write(int b) |
close, flush, write, writepublic MultiplexingOutputStream(OutputStream streamOne, OutputStream streamTwo)
streamOne - the 1st stream to delegate writes to.streamTwo - the 2nd stream to delegate writes to.public void addOutputStream(OutputStream delegate)
delegate - another stream that will receive any write that is done on this
instance.public boolean removeOutputStream(OutputStream delegate)
delegate - a stream that should not receive any write that is done on this
instance any more.public void write(int b)
throws IOException
write 在类中 OutputStreamIOExceptionOutputStream.write(int)Copyright © 2016. All rights reserved.