|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.io.Reader
java.io.BufferedReader
com.marringtons.io.RecordingBufferedReader
Use this class instead of BufferedReader to record traffic through the reader. It is a programmatic equivalent of the Unix tee command. It only records once asked to do so. When on, the reader behaves as normal passing information as expected, but all the information passed is also sent to an independant Writer object.
| Constructor Summary | |
RecordingBufferedReader(Reader in)
Create a buffered reader that can also record the traffic on demand. |
|
| Method Summary | |
int |
read()
Overridden read method to record if recording turned on. |
int |
read(char[] buffer,
int offset,
int length)
Overridden read method to record if recording turned on. |
String |
readLine()
Overridden read method to record if recording turned on. |
void |
record(Writer writer)
Turn recording on. |
void |
stop()
Close and turn off recording. |
| Methods inherited from class java.io.BufferedReader |
close, mark, markSupported, ready, reset, skip |
| Methods inherited from class java.io.Reader |
read |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RecordingBufferedReader(Reader in)
in - reader we want to record as it performs| Method Detail |
public void record(Writer writer)
writer - where to write recording as it occurs.
public void stop()
throws IOException
IOException
public int read()
throws IOException
IOExceptionReader.read()
public int read(char[] buffer,
int offset,
int length)
throws IOException
buffer - to read into.offset - to read into buffer.length - characters to read.
IOExceptionReader.read(char[], int, int)
public String readLine()
throws IOException
IOExceptionBufferedReader.readLine()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||