de.esprit.appsuite.io

## Class ProgressFileInputStream

- java.lang.Object
- - java.io.InputStream
  - - java.io.FileInputStream
    - - de.esprit.appsuite.io.ProgressFileInputStream

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

      public class ProgressFileInputStream
      extends java.io.FileInputStream

  This stream reads data via the Channel of the given `FileInputStream` and generates a progress notification for each percentage read (max 100 in total).
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProgressFileInputStream(java.io.File file)`
    `ProgressFileInputStream(LocalFileInfo fileInfo)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `FileInfo` | `getFileInfo()`
    `int` | `getProgressCount()` Returns the number of progress calls that have been made.
    `long` | `getReadBytes()` Returns the number of bytes already read from this stream
    `long` | `getTotalBytes()`
    `int` | `read()`
    `int` | `read(byte[] b)`
    `int` | `read(byte[] b, int off, int len)`
    `void` | `setProgressor(AsyncExecutable progressorTask)`
    `long` | `skip(long bytes)`

    - ### Methods inherited from class java.io.FileInputStream

      `available, close, finalize, getChannel, getFD`

    - ### Methods inherited from class java.io.InputStream

      `mark, markSupported, reset`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProgressFileInputStream

          public ProgressFileInputStream(java.io.File file)
                                  throws java.io.FileNotFoundException

      Throws:
        `java.io.FileNotFoundException`

    - #### ProgressFileInputStream

          public ProgressFileInputStream(LocalFileInfo fileInfo)
                                  throws java.io.FileNotFoundException

      Throws:
        `java.io.FileNotFoundException`

  - ### Method Detail

    - #### setProgressor

          public void setProgressor(AsyncExecutable progressorTask)

    - #### getReadBytes

          public long getReadBytes()

      Returns the number of bytes already read from this stream

    - #### getTotalBytes

          public long getTotalBytes()

    - #### getFileInfo

          public FileInfo getFileInfo()

    - #### getProgressCount

          public int getProgressCount()

      Returns the number of progress calls that have been made.

    - #### skip

          public long skip(long bytes)
                    throws java.io.IOException

      Overrides:
        `skip` in class `java.io.FileInputStream`
      Throws:
        `java.io.IOException`

    - #### read

          public int read()
                   throws java.io.IOException

      Overrides:
        `read` in class `java.io.FileInputStream`
      Throws:
        `java.io.IOException`

    - #### read

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

      Overrides:
        `read` in class `java.io.FileInputStream`
      Throws:
        `java.io.IOException`

    - #### read

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

      Overrides:
        `read` in class `java.io.FileInputStream`
      Throws:
        `java.io.IOException`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.