org.fuin.utils4swing.progress
Class FileCopyProgressInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by org.fuin.utils4swing.progress.FileCopyProgressInputStream
All Implemented Interfaces:
java.io.Closeable

public class FileCopyProgressInputStream
extends java.io.FilterInputStream

Updates the attached FileCopyProgressMonitor while bytes are read.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
FileCopyProgressInputStream(FileCopyProgressListener listener, java.io.InputStream inputStream, int size)
          Constructor with monitor, stream and file size.
 
Method Summary
 void close()
          
 int read()
          
 int read(byte[] b)
          
 int read(byte[] b, int off, int len)
          
 void reset()
          
 long skip(long n)
          
 
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileCopyProgressInputStream

public FileCopyProgressInputStream(FileCopyProgressListener listener,
                                   java.io.InputStream inputStream,
                                   int size)
Constructor with monitor, stream and file size.

Parameters:
listener - Listener to inform about progress - Can be null but makes not much sense to use this class in this case.
inputStream - Input stream to use.
size - Size of the input stream.
Method Detail

read

public final int read()
               throws java.io.IOException

Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

read

public final int read(byte[] b)
               throws java.io.IOException

Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

read

public final int read(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException

Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

skip

public final long skip(long n)
                throws java.io.IOException

Overrides:
skip in class java.io.FilterInputStream
Throws:
java.io.IOException

close

public final 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

reset

public final void reset()
                 throws java.io.IOException

Overrides:
reset in class java.io.FilterInputStream
Throws:
java.io.IOException


Copyright © 2009 Future Invent Informationsmanagement GmbH. All Rights Reserved.