Package de.intarsys.tools.writer
Class LogWriter
java.lang.Object
java.io.Writer
java.io.FilterWriter
de.intarsys.tools.writer.LogWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
A writer that logs any char written.
The writer is piped in the writing process, any characters written are copied to an associated writer object.
Client -> LogWriter -> Writer -> Destination | v Writer (Copy)
-
Field Summary
Fields inherited from class java.io.FilterWriter
out
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LogWriter
EscapeWriter constructor comment.- Parameters:
o
- java.io.Writerlog
-
-
-
Method Details
-
close
Close the stream, flushing it first. Once a stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously-closed stream, however, has no effect.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterWriter
- Throws:
IOException
- If an I/O error occurs
-
flush
Flush the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classFilterWriter
- Throws:
IOException
- If an I/O error occurs
-
getLog
-
write
- Overrides:
write
in classFilterWriter
- Throws:
IOException
-
write
- Overrides:
write
in classFilterWriter
- Throws:
IOException
-
write
- Overrides:
write
in classFilterWriter
- Throws:
IOException
-