org.das2.util
Class DasProgressMonitorInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by org.das2.util.DasProgressMonitorInputStream
All Implemented Interfaces:
java.io.Closeable

public class DasProgressMonitorInputStream
extends java.io.FilterInputStream


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
DasProgressMonitorInputStream(java.io.InputStream in, ProgressMonitor monitor)
          Creates a new instance of DasProgressMonitorInputStream
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds a PropertyChangeListener to the listener list.
 void close()
           
 long getStreamLength()
          Getter for property taskSize.
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes a PropertyChangeListener from the listener list.
 void setEnableProgressPosition(boolean value)
          disable/enable setting of progress position, true by default.
 void setStreamLength(long taskSize)
          Setter for property taskSize.
 
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DasProgressMonitorInputStream

public DasProgressMonitorInputStream(java.io.InputStream in,
                                     ProgressMonitor monitor)
Creates a new instance of DasProgressMonitorInputStream

Method Detail

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.FilterInputStream
Throws:
java.io.IOException

setEnableProgressPosition

public void setEnableProgressPosition(boolean value)
disable/enable setting of progress position, true by default. Transfer rate will still be reported. This is introduced in case another agent (the das2Stream reader, in particular) can set the progress position more accurately.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a PropertyChangeListener to the listener list.

Parameters:
l - The listener to add.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a PropertyChangeListener from the listener list.

Parameters:
l - The listener to remove.

getStreamLength

public long getStreamLength()
Getter for property taskSize.

Returns:
Value of property taskSize.

setStreamLength

public void setStreamLength(long taskSize)
Setter for property taskSize.

Parameters:
taskSize - New value of property taskSize.