|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Writer org.sadun.util.TieWriter
An Writer which ties output to two underlying streams. Any character written to the stream is replicated on both.
Field Summary |
Fields inherited from class java.io.Writer |
lock |
Constructor Summary | |
TieWriter(java.io.Writer w1,
java.io.Writer w2)
Build a Writer that ties togheter the two given streams. |
Method Summary | |
void |
close()
Close both underlying streams |
void |
flush()
Flush both underlying streams |
java.io.Writer |
getFirstWriter()
Return the first of the two tied writers |
java.io.Writer |
getSecondWriter()
Return the second of the two tied writers |
static void |
main(java.lang.String[] args)
|
void |
write(char[] buf,
int off,
int len)
Write a byte to the stream, and thus to the two underlying streams. |
Methods inherited from class java.io.Writer |
write, write, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TieWriter(java.io.Writer w1, java.io.Writer w2)
w1
- the first streamw2
- the second streamMethod Detail |
public void write(char[] buf, int off, int len) throws java.io.IOException
java.io.IOException
- if something fails during writingpublic void close() throws java.io.IOException
java.io.IOException
- if something fails during closingpublic void flush() throws java.io.IOException
java.io.IOException
- if something fails during flushingpublic java.io.Writer getFirstWriter()
public java.io.Writer getSecondWriter()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |