Package de.intarsys.tools.reader
Class LogReader
java.lang.Object
java.io.Reader
java.io.FilterReader
de.intarsys.tools.reader.LogReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
A reader that logs any char read.
The reader is piped in the reading process, any characters read are written to an associated writer object.
Client -> LogReader -> Reader -> Source | v Writertodo make closing of associated writer configurable
-
Field Summary
Fields inherited from class java.io.FilterReader
in
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.FilterReader
mark, markSupported, ready, reset, skip
Methods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
Constructor Details
-
LogReader
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterReader
- Throws:
IOException
-
getLog
-
read
- Overrides:
read
in classFilterReader
- Throws:
IOException
-
read
Read characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.- Overrides:
read
in classFilterReader
- Parameters:
cbuf
- Destination bufferoff
- Offset at which to start storing characterslen
- Maximum number of characters to read- Returns:
- The number of characters read, or -1 if the end of the stream has been reached
- Throws:
IOException
- If an I/O error occurs
-
setLog
-