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:
Closeable

public class FileCopyProgressInputStream
extends FilterInputStream

Updates the attached FileCopyProgressMonitor while bytes are read.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
FileCopyProgressInputStream(FileCopyProgressListener listener, 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,
                                   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 IOException

Overrides:
read in class FilterInputStream
Throws:
IOException

read

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

Overrides:
read in class FilterInputStream
Throws:
IOException

read

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

Overrides:
read in class FilterInputStream
Throws:
IOException

skip

public final long skip(long n)
                throws IOException

Overrides:
skip in class FilterInputStream
Throws:
IOException

close

public final void close()
                 throws IOException

Specified by:
close in interface Closeable
Overrides:
close in class FilterInputStream
Throws:
IOException

reset

public final void reset()
                 throws IOException

Overrides:
reset in class FilterInputStream
Throws:
IOException


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