nl.knowledgeplaza.util.io
Class TeeWriter
java.lang.Object
java.io.Writer
nl.knowledgeplaza.util.io.TeeWriter
- All Implemented Interfaces:
- Closeable, Flushable, Appendable
public class TeeWriter
- extends Writer
This class mirrors output between two writers.
- See Also:
Writer
|
Method Summary |
void |
close()
Close the underlying Writers. |
void |
flush()
Flush both underlying Writers. |
void |
write(char[] cbuf,
int off,
int len)
Write the specified int to each of the underlying Writers. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TeeWriter
public TeeWriter(Writer first,
Writer second)
- The constructor takes two Writers. It will mirror any
calls to each Writer.
- Parameters:
first - The first output streamsecond - The second output stream
write
public void write(char[] cbuf,
int off,
int len)
throws IOException
- Write the specified int to each of the underlying Writers.
- Specified by:
write in class Writer
- Parameters:
i - The int to write to the underlying streams.
- Throws:
IOException - If one of the underlying streams throws it.
flush
public void flush()
throws IOException
- Flush both underlying Writers.
- Specified by:
flush in interface Flushable- Specified by:
flush in class Writer
- Throws:
IOException - If one of the underlying streams throws it.
close
public void close()
throws IOException
- Close the underlying Writers.
- Specified by:
close in interface Closeable- Specified by:
close in class Writer
- Throws:
IOException - If one of the underlying streams throws it.
Copyright © 2012 KnowledgePlaza. All Rights Reserved.