public class ProgressOutputStream extends java.io.OutputStream
OutputStream
which reports progress to the ProgressMonitor
.Modifier and Type | Field and Description |
---|---|
private boolean |
finishOnClose |
private java.io.OutputStream |
out |
private StreamProgressUpdater |
updater |
Constructor and 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 . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
private final StreamProgressUpdater updater
private final java.io.OutputStream out
private final boolean finishOnClose
public ProgressOutputStream(java.io.OutputStream out, long size, ProgressMonitor progressMonitor, boolean finishOnClose)
ProgressOutputStream
.out
- the stream to monitorsize
- the total size which will be sentprogressMonitor
- the monitor to report tofinishOnClose
- whether to call ProgressMonitor.finishTask()
when this stream is closedpublic ProgressOutputStream(java.io.OutputStream out, long size, ProgressMonitor progressMonitor, java.lang.String message, boolean finishOnClose)
ProgressOutputStream
.out
- the stream to monitorsize
- the total size which will be sentprogressMonitor
- the monitor to report tomessage
- the message that will be displayed by the inner StreamProgressUpdater
finishOnClose
- whether to call ProgressMonitor.finishTask()
when this stream is closedpublic void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException