Class ProgressInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.commons.io.input.ProxyInputStream
org.opencastproject.util.ProgressInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class ProgressInputStream extends org.apache.commons.io.input.ProxyInputStream
An InputStream that counts the number of bytes read.
  • Constructor Details

    • ProgressInputStream

      public ProgressInputStream(InputStream in)
  • Method Details

    • getTotalNumBytesRead

      public long getTotalNumBytesRead()
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener l)
      Adds a PropertyChangeListener The listener gets notified as soon as the input stream is read.
      Parameters:
      l - the PropertyChangeListener
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener l)
      Removes a PropertyChangeListener The listener gets notified as soon as the input stream is read.
      Parameters:
      l - the PropertyChangeListener
    • read

      public int read() throws IOException
      Overrides:
      read in class org.apache.commons.io.input.ProxyInputStream
      Throws:
      IOException
    • read

      public int read(byte[] b) throws IOException
      Overrides:
      read in class org.apache.commons.io.input.ProxyInputStream
      Throws:
      IOException
    • read

      public int read(byte[] b, int off, int len) throws IOException
      Overrides:
      read in class org.apache.commons.io.input.ProxyInputStream
      Throws:
      IOException
    • skip

      public long skip(long n) throws IOException
      Overrides:
      skip in class org.apache.commons.io.input.ProxyInputStream
      Throws:
      IOException
    • mark

      public void mark(int readlimit)
      Overrides:
      mark in class org.apache.commons.io.input.ProxyInputStream
    • reset

      public void reset() throws IOException
      Overrides:
      reset in class org.apache.commons.io.input.ProxyInputStream
      Throws:
      IOException
    • markSupported

      public boolean markSupported()
      Overrides:
      markSupported in class org.apache.commons.io.input.ProxyInputStream