edu.emory.mathcs.util.io
Interface RedirectibleReader

All Known Implementing Classes:
RedirectingReader

public interface RedirectibleReader

Character input source capable of redirecting characters to a writer. It means that instead of reading characters into an array and then feeding them to the writer, the characters may be moved directly from the reader to the writer.

Version:
1.0
Author:
Dawid Kurzyniec

Method Summary
 int redirect(java.io.Writer dest, int len)
          Reads and redirects up to the len characters to a specified writer.
 int redirectAll(java.io.Writer dest)
          Readirects all further data from this reader into the specified writer, until EOF.
 

Method Detail

redirect

public int redirect(java.io.Writer dest,
                    int len)
             throws java.io.IOException
Reads and redirects up to the len characters to a specified writer. Returns the number of characters actually redirected.

Parameters:
dest - the destination writer
len - the maximum number of characters to redirect
Returns:
number of characters actually redirected
Throws:
java.io.IOException - if I/O error occurs

redirectAll

public int redirectAll(java.io.Writer dest)
                throws java.io.IOException
Readirects all further data from this reader into the specified writer, until EOF. Returns the number of characters actually redirected.

Parameters:
dest - the destination writer
Returns:
number of characters actually redirected
Throws:
java.io.IOException - if I/O error occurs