org.jdesktop.wonderland.client.assetmgr
Class TrackingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by org.jdesktop.wonderland.client.assetmgr.TrackingInputStream
All Implemented Interfaces:
java.io.Closeable

public class TrackingInputStream
extends java.io.FilterInputStream

Track the IO and notify the listeners of progress

Author:
paulby

Nested Class Summary
static interface TrackingInputStream.ProgressListener
           
 
Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
TrackingInputStream(java.io.InputStream stream)
          Notify the user every time the number of byte downloaded is a multiple of notifySize.
 
Method Summary
 void close()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 boolean removeListener(TrackingInputStream.ProgressListener listener)
           
 void setListener(TrackingInputStream.ProgressListener listener, int notifySize, int totalSize)
           
 
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

TrackingInputStream

public TrackingInputStream(java.io.InputStream stream)
Notify the user every time the number of byte downloaded is a multiple of notifySize.

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

setListener

public void setListener(TrackingInputStream.ProgressListener listener,
                        int notifySize,
                        int totalSize)

removeListener

public boolean removeListener(TrackingInputStream.ProgressListener listener)


Open Wonderland - http://openwonderland.org