com.jalios.io
Class MonitoredInputStream
java.lang.Object
  
java.io.InputStream
      
java.io.FilterInputStream
          
java.io.BufferedInputStream
              
com.jalios.io.MonitoredInputStream
- All Implemented Interfaces: 
 - Closeable
 
public class MonitoredInputStream
- extends BufferedInputStream
 
A BufferedInputStream that count bytes read to display the status of
 the stream.
- Version:
 
  - $Revision: 14875 $
 
- Author:
 
  - Jean-Philippe
 
 
 
 
 
| 
Method Summary | 
 long | 
getSpentTime(boolean elapse)
 
          Return the time spent into this output stream | 
 long | 
getStatus(boolean absolute,
          boolean done)
 
          Return the status of the stream. | 
 int | 
read()
 
          Delegate Read to super class, count charactere read. | 
 int | 
read(byte[] b,
     int off,
     int len)
 
          Delegate Read to super class, count charactere read. | 
 
 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
REVISION
public static final String REVISION
- See Also:
 - Constant Field Values
 
maxlength
protected long maxlength
readlength
protected long readlength
startingTime
protected long startingTime
MonitoredInputStream
public MonitoredInputStream(InputStream stream,
                            int size,
                            long maxlength)
read
public int read()
         throws IOException
- Delegate Read to super class, count charactere read.
- Overrides:
 read in class BufferedInputStream
 
- Throws:
 IOException- See Also:
 InputStream.read()
 
 
read
public int read(byte[] b,
                int off,
                int len)
         throws IOException
- Delegate Read to super class, count charactere read.
- Overrides:
 read in class BufferedInputStream
 
- Throws:
 IOException- See Also:
 InputStream.read(byte[], int, int)
 
 
getStatus
public long getStatus(boolean absolute,
                      boolean done)
- Return the status of the stream. How many bytes have been read.
- Parameters:
 absolute - if return an absolute value or percentagedone - if return the available byte or done bytes
- Returns:
 - long the status of the stream
 
 
 
getSpentTime
public long getSpentTime(boolean elapse)
- Return the time spent into this output stream
- Parameters:
 elapse - true return time spent, false return time to spent
- Returns:
 - the duration
 - Since:
 
  - jcms-4.2
 
 
 
Copyright © 2001-2010 Jalios SA. All Rights Reserved.