jfileupload.transfer.client.core
Class TriggeredInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.BufferedInputStream
              extended by jfileupload.transfer.client.core.TriggeredInputStream
All Implemented Interfaces:
java.io.Closeable

public class TriggeredInputStream
extends java.io.BufferedInputStream

This class extends BufferedInputStream to provide events on data loading.


Field Summary
protected  java.util.List listeners
           
protected  boolean notification
           
 
Fields inherited from class java.io.BufferedInputStream
buf, count, marklimit, markpos, pos
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
TriggeredInputStream(java.io.InputStream in, int size, java.util.List listeners)
           
TriggeredInputStream(java.io.InputStream in, java.util.List listeners)
           
 
Method Summary
protected  void notifyListeners(long size)
          Notify listeners about current data loaded.
 int read()
           
 int read(byte[] b, int offset, int length)
           
 void setMaxlength(long maxlength)
           
 long skip(long bytes)
           
 
Methods inherited from class java.io.BufferedInputStream
available, close, mark, markSupported, reset
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected java.util.List listeners

notification

protected boolean notification
Constructor Detail

TriggeredInputStream

public TriggeredInputStream(java.io.InputStream in,
                            java.util.List listeners)
Parameters:
in -

TriggeredInputStream

public TriggeredInputStream(java.io.InputStream in,
                            int size,
                            java.util.List listeners)
Parameters:
in -
size -
Method Detail

read

public int read(byte[] b,
                int offset,
                int length)
         throws java.io.IOException
Overrides:
read in class java.io.BufferedInputStream
Throws:
java.io.IOException

read

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

skip

public long skip(long bytes)
          throws java.io.IOException
Overrides:
skip in class java.io.BufferedInputStream
Throws:
java.io.IOException

notifyListeners

protected void notifyListeners(long size)
Notify listeners about current data loaded.

Parameters:
size -

setMaxlength

public void setMaxlength(long maxlength)