com.croftsoft.core.io
Class EchoReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.FilterReader
          extended by com.croftsoft.core.io.EchoReader
All Implemented Interfaces:
Closeable, Readable

public final class EchoReader
extends FilterReader

A FilterReader that echoes characters read to a Writer.

Since:
2002-09-19
Version:
2002-09-19
Author:
David Wallace Croft

Field Summary
 
Fields inherited from class java.io.FilterReader
in
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
EchoReader(Reader in)
          Echoes to the standard output.
EchoReader(Reader in, Writer echoWriter)
          Main constructor.
 
Method Summary
 void close()
          Flushes the echoWriter in addition to closing the input.
 int read()
           
 int read(char[] cbuf)
           
 int read(char[] cbuf, int off, int len)
           
 
Methods inherited from class java.io.FilterReader
mark, markSupported, ready, reset, skip
 
Methods inherited from class java.io.Reader
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EchoReader

public EchoReader(Reader in,
                  Writer echoWriter)
Main constructor.


EchoReader

public EchoReader(Reader in)
Echoes to the standard output.
this ( in, new PrintWriter ( System.out ) );

Method Detail

read

public int read()
         throws IOException
Overrides:
read in class FilterReader
Throws:
IOException

read

public int read(char[] cbuf,
                int off,
                int len)
         throws IOException
Overrides:
read in class FilterReader
Throws:
IOException

read

public int read(char[] cbuf)
         throws IOException
Overrides:
read in class Reader
Throws:
IOException

close

public void close()
           throws IOException
Flushes the echoWriter in addition to closing the input.

Specified by:
close in interface Closeable
Overrides:
close in class FilterReader
Throws:
IOException

CroftSoft Javadoc

CroftSoft Core Javadoc (2008-09-28 20:58:02)