Class ProgressOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class ProgressOutputStream
    extends java.io.OutputStream
    An OutputStream which reports progress to the ProgressMonitor.
    Since:
    9185
    • Constructor Summary

      Constructors 
      Constructor Description
      ProgressOutputStream​(java.io.OutputStream out, long size, ProgressMonitor progressMonitor, boolean finishOnClose)
      Constructs a new ProgressOutputStream.
      ProgressOutputStream​(java.io.OutputStream out, long size, ProgressMonitor progressMonitor, java.lang.String message, boolean finishOnClose)
      Constructs a new ProgressOutputStream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void write​(byte[] b, int off, int len)  
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

        flush, nullOutputStream, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProgressOutputStream

        public ProgressOutputStream​(java.io.OutputStream out,
                                    long size,
                                    ProgressMonitor progressMonitor,
                                    boolean finishOnClose)
        Constructs a new ProgressOutputStream.
        Parameters:
        out - the stream to monitor
        size - the total size which will be sent
        progressMonitor - the monitor to report to
        finishOnClose - whether to call ProgressMonitor.finishTask() when this stream is closed
        Since:
        10302
      • ProgressOutputStream

        public ProgressOutputStream​(java.io.OutputStream out,
                                    long size,
                                    ProgressMonitor progressMonitor,
                                    java.lang.String message,
                                    boolean finishOnClose)
        Constructs a new ProgressOutputStream.
        Parameters:
        out - the stream to monitor
        size - the total size which will be sent
        progressMonitor - the monitor to report to
        message - the message that will be displayed by the inner StreamProgressUpdater
        finishOnClose - whether to call ProgressMonitor.finishTask() when this stream is closed
        Since:
        12711
    • Method Detail

      • write

        public void write​(byte[] b,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException