public class ProgressOutputStream
extends java.io.OutputStream
OutputStream that can report the progress of writing to another OutputStream to a
ProgressListener.| Constructor and Description |
|---|
ProgressOutputStream(java.io.OutputStream stream,
ProgressListener listener,
long total)
Constructs a ProgressOutputStream that wraps another OutputStream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getTotal()
Returns the total number of bytes expected to be read from the stream.
|
void |
setTotal(long total)
Sets the total number of bytes expected to be read from the stream.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public ProgressOutputStream(java.io.OutputStream stream,
ProgressListener listener,
long total)
stream - the stream whose progress will be monitored.listener - the listener that will receive progress updates.total - the total number of bytes that are expected to be read from the stream.public long getTotal()
public void setTotal(long total)
total - the total number of bytes that are expected to be read from the stream.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException