org.amicofragile.io
Class TeeOutputStream
java.lang.Object
java.io.OutputStream
org.amicofragile.io.TeeOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class TeeOutputStream
- extends OutputStream
OutputStream
which delegates to multiple OutputStream
s.
- Author:
- Pietro Martinelli
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mainStream
private final OutputStream mainStream
- First stream to delegate to.
streams
private final OutputStream[] streams
- Other streams to delegate to.
TeeOutputStream
public TeeOutputStream(OutputStream mainStream,
OutputStream... streams)
- Parameters:
mainStream
- First nested streamstreams
- Optional nested streams
write
public final void write(int b)
throws IOException
- Specified by:
write
in class OutputStream
- Parameters:
b
- byte to write
- Throws:
IOException
- when nested stream throws- See Also:
OutputStream.write(int)
flush
public final void flush()
throws IOException
- Specified by:
flush
in interface Flushable
- Overrides:
flush
in class OutputStream
- Throws:
IOException
- when nested stream throws- See Also:
OutputStream.flush()
close
public final void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class OutputStream
- Throws:
IOException
- when nested stream throws- See Also:
OutputStream.close()
Copyright © 2010. All Rights Reserved.