edu.emory.mathcs.util.io
Interface TimedRedirectibleInput
- All Superinterfaces:
- Input, RedirectibleInput, TimedInput
- public interface TimedRedirectibleInput
- extends TimedInput, RedirectibleInput
Input source that is both redirectible and supports timeout read.
- Version:
- 1.0
- Author:
- Dawid Kurzyniec
Method Summary |
int |
timedRedirect(java.io.OutputStream dest,
int len,
long timeout)
Reads with timeout and redirects up to the len bytes of
data to a specified output stream. |
timedRedirect
public int timedRedirect(java.io.OutputStream dest,
int len,
long timeout)
throws java.io.IOException,
TimeoutException
- Reads with timeout and redirects up to the
len
bytes of
data to a specified output stream. Returns the number of bytes actually
redirected.
If nonzero bytes is requested but no data is available within the
specified timeout and the stream is not at EOF, TimeoutException is
thrown.
- Parameters:
dest
- the destination streamlen
- the maximum number of bytes to redirecttimeout
- the maximum number of milliseconds to wait before data
is available
- Returns:
- number of bytes actually redirected
- Throws:
java.io.IOException
- if IOException occurs
TimeoutException
- if timeout occurs before data is available