org.das2.util
Class DasProgressMonitorReadableByteChannel

java.lang.Object
  extended by org.das2.util.DasProgressMonitorReadableByteChannel
All Implemented Interfaces:
java.io.Closeable, java.nio.channels.Channel, java.nio.channels.ReadableByteChannel

public class DasProgressMonitorReadableByteChannel
extends java.lang.Object
implements java.nio.channels.ReadableByteChannel


Constructor Summary
DasProgressMonitorReadableByteChannel(java.nio.channels.ReadableByteChannel 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.
 boolean isOpen()
           
 int read(java.nio.ByteBuffer dst)
           
 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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DasProgressMonitorReadableByteChannel

public DasProgressMonitorReadableByteChannel(java.nio.channels.ReadableByteChannel in,
                                             ProgressMonitor monitor)
Creates a new instance of DasProgressMonitorInputStream

Method Detail

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in interface java.nio.channels.Channel
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.

read

public int read(java.nio.ByteBuffer dst)
         throws java.io.IOException
Specified by:
read in interface java.nio.channels.ReadableByteChannel
Throws:
java.io.IOException

isOpen

public boolean isOpen()
Specified by:
isOpen in interface java.nio.channels.Channel