edu.emory.mathcs.util.io
Interface RedirectibleInput

All Superinterfaces:
Input
All Known Subinterfaces:
TimedRedirectibleInput
All Known Implementing Classes:
RedirectingInputStream

public interface RedirectibleInput
extends Input

Input source capable of redirecting the data to an output stream. It means that instead of reading data into an array and then feeding it to the output stream, the data may be moved directly from the input to the output.

Version:
1.0
Author:
Dawid Kurzyniec

Method Summary
 int redirect(java.io.OutputStream dest, int len)
          Reads and redirects up to the len bytes of data to a specified output stream.
 int redirectAll(java.io.OutputStream dest)
          Readirects all further data from this input into the specified output stream, until EOF.
 
Methods inherited from interface edu.emory.mathcs.util.io.Input
available, close, mark, markSupported, read, read, read, reset, skip
 

Method Detail

redirect

public int redirect(java.io.OutputStream dest,
                    int len)
             throws java.io.IOException
Reads and redirects up to the len bytes of data to a specified output stream. Returns the number of bytes actually redirected.

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

redirectAll

public int redirectAll(java.io.OutputStream dest)
                throws java.io.IOException
Readirects all further data from this input into the specified output stream, until EOF. Returns the number of bytes actually redirected.

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