com.frinika.tools
Class ProgressBarInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.frinika.tools.ProgressBarInputStream
All Implemented Interfaces:
java.io.Closeable

public class ProgressBarInputStream
extends java.io.InputStream

Generic inputstream for updating a progressbar while reading. Use this between an input stream reader and the inputstream to read.

Author:
Peter Johan Salomonsen

Constructor Summary
ProgressBarInputStream(javax.swing.JProgressBar progressBar, java.io.InputStream inputStream)
           
 
Method Summary
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressBarInputStream

public ProgressBarInputStream(javax.swing.JProgressBar progressBar,
                              java.io.InputStream inputStream)
Parameters:
progressBar - the progressbar to update
inputStream - the inputstream to read
Method Detail

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

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

read

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