org.apache.james.util.watchdog
Class BytesWrittenResetOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--org.apache.james.util.watchdog.BytesWrittenResetOutputStream

public class BytesWrittenResetOutputStream
extends OutputStream

This will reset the Watchdog each time a certain amount of data has been transferred. This allows us to keep the timeout settings low, while not timing out during large data transfers.


Constructor Summary
BytesWrittenResetOutputStream(OutputStream out, Watchdog watchdog, int lengthReset)
           
 
Method Summary
 void close()
          Close the stream
 void flush()
          Flush the stream
 void write(byte[] b, int off, int len)
          Write an array of bytes to the stream
 void write(int b)
          Write a byte to the stream
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BytesWrittenResetOutputStream

public BytesWrittenResetOutputStream(OutputStream out,
                                     Watchdog watchdog,
                                     int lengthReset)
Method Detail

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Write an array of bytes to the stream

Overrides:
write in class OutputStream
Parameters:
b - the array of bytes to write to the stream
off - the index in the array where we start writing
len - the number of bytes of the array to write
Throws:
IOException - if an exception is encountered when writing

write

public void write(int b)
           throws IOException
Write a byte to the stream

Specified by:
write in class OutputStream
Parameters:
b - the byte to write to the stream
Throws:
IOException - if an exception is encountered when writing

flush

public void flush()
           throws IOException
Flush the stream

Overrides:
flush in class OutputStream
Throws:
IOException - if an exception is encountered when flushing

close

public void close()
           throws IOException
Close the stream

Overrides:
close in class OutputStream
Throws:
IOException - if an exception is encountered when closing


"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."