nl.knowledgeplaza.util.io
Class TeeWriter
java.lang.Object
java.io.Writer
nl.knowledgeplaza.util.io.TeeWriter
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, java.lang.Appendable
public class TeeWriter
- extends java.io.Writer
This class mirrors output between two writers.
- See Also:
Writer
| Fields inherited from class java.io.Writer |
lock |
|
Constructor Summary |
TeeWriter(java.io.Writer first,
java.io.Writer second)
The constructor takes two Writers. |
|
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.io.Writer |
append, append, append, write, write, write, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TeeWriter
public TeeWriter(java.io.Writer first,
java.io.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 java.io.IOException
- Write the specified int to each of the underlying Writers.
- Specified by:
write in class java.io.Writer
- Parameters:
i - The int to write to the underlying streams.
- Throws:
java.io.IOException - If one of the underlying streams throws it.
flush
public void flush()
throws java.io.IOException
- Flush both underlying Writers.
- Specified by:
flush in interface java.io.Flushable- Specified by:
flush in class java.io.Writer
- Throws:
java.io.IOException - If one of the underlying streams throws it.
close
public void close()
throws java.io.IOException
- Close the underlying Writers.
- Specified by:
close in interface java.io.Closeable- Specified by:
close in class java.io.Writer
- Throws:
java.io.IOException - If one of the underlying streams throws it.
Copyright © 2010. All Rights Reserved.