org.apache.james.util
Class SchedulerNotifyInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--org.apache.james.util.SchedulerNotifyInputStream
- public class SchedulerNotifyInputStream
- extends InputStream
This will reset the scheduler each time a certain amount of data has
been transfered. This allows us to keep the timeout settings low, while
not timing out during large data transfers.
Method Summary |
void |
close()
Close the stream |
int |
read()
Read a byte from the stream |
int |
read(byte[] b,
int off,
int len)
Read an array of bytes from the stream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SchedulerNotifyInputStream
public SchedulerNotifyInputStream(InputStream in,
TimeScheduler scheduler,
String triggerName,
int lengthReset)
- Parameters:
in
- the InputStream to be wrapped by this streamscheduler
- the TimeScheduler managing the trigger to be reset by this streamtriggerName
- the name of the particular trigger to be reset by this streamlengthReset
- the number of bytes to be read in between trigger resets
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Read an array of bytes from the stream
- Overrides:
read
in class InputStream
- Parameters:
b
- the array of bytes to read from the streamoff
- the index in the array where we start writinglen
- the number of bytes of the array to read
- Returns:
- the number of bytes read
- Throws:
IOException
- if an exception is encountered when reading
read
public int read()
throws IOException
- Read a byte from the stream
- Specified by:
read
in class InputStream
- Returns:
- the byte read from the stream
- Throws:
IOException
- if an exception is encountered when reading
close
public void close()
throws IOException
- Close the stream
- Overrides:
close
in class InputStream
- Throws:
IOException
- if an exception is encountered when closing
"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."