de.esprit.appsuite.io

## Class AccumulatingProgressInputStream

- java.lang.Object
- - java.io.InputStream
  - - de.esprit.appsuite.io.AccumulatingProgressInputStream

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

      public class AccumulatingProgressInputStream
      extends java.io.InputStream

  This is a special stream that allows to change the actually read stream from outside. All bytes read from any current stream are accumulated until the totalBytes are read and progress is fired accordingly. This class is used i.e. for reading many files and providing a continuous progress notification across all.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccumulatingProgressInputStream(AsyncExecutable progressorTask)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `available()`
    `void` | `close()`
    `long` | `getReadBytes()`
    `void` | `mark(int readlimit)`
    `boolean` | `markSupported()`
    `int` | `read()`
    `int` | `read(byte[] b)`
    `int` | `read(byte[] b, int off, int len)`
    `void` | `reset()`
    `void` | `setCurrentStream(java.io.InputStream currStream)`
    `void` | `setTotalBytes(long totalBytes)`
    `long` | `skip(long n)`

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

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

- - ### Constructor Detail

    - #### AccumulatingProgressInputStream

          public AccumulatingProgressInputStream(AsyncExecutable progressorTask)

  - ### Method Detail

    - #### setTotalBytes

          public void setTotalBytes(long totalBytes)

    - #### getReadBytes

          public long getReadBytes()

    - #### setCurrentStream

          public void setCurrentStream(java.io.InputStream currStream)

    - #### 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)
                   throws java.io.IOException

      Overrides:
        `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`

    - #### skip

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

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

    - #### reset

          public void reset()
                     throws java.io.IOException

      Overrides:
        `reset` in class `java.io.InputStream`
      Throws:
        `java.io.IOException`

    - #### markSupported

          public boolean markSupported()

      Overrides:
        `markSupported` in class `java.io.InputStream`

    - #### close

          public void close()
                     throws java.io.IOException

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Overrides:
        `close` in class `java.io.InputStream`
      Throws:
        `java.io.IOException`

    - #### available

          public int available()
                        throws java.io.IOException

      Overrides:
        `available` in class `java.io.InputStream`
      Throws:
        `java.io.IOException`

    - #### mark

          public void mark(int readlimit)

      Overrides:
        `mark` in class `java.io.InputStream`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.