com.netease.cloud.services.nos.internal
public class ProgressReportingInputStream extends FilterInputStream
in
Constructor and Description |
---|
ProgressReportingInputStream(InputStream in,
ProgressListener listener)
Creates a new progress reporting input stream that simply wraps the
specified input stream and notifies the specified listener occasionally
about the number of bytes transfered.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
getFireCompletedEvent()
Returns whether this input stream should fire an event with code
ProgressEvent.COMPLETED_EVENT_CODE when this stream runs out of
data. |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
setFireCompletedEvent(boolean fireCompletedEvent)
Sets whether this input stream should fire an event with code
ProgressEvent.COMPLETED_EVENT_CODE when this stream runs out of
data. |
available, mark, markSupported, read, reset, skip
public ProgressReportingInputStream(InputStream in, ProgressListener listener)
in
- The input stream to wrap.listener
- The listener to notify about progress.public void setFireCompletedEvent(boolean fireCompletedEvent)
ProgressEvent.COMPLETED_EVENT_CODE
when this stream runs out of
data. By default, completed events are not fired by this stream.fireCompletedEvent
- Whether this input stream should fire an event to indicate
that the stream has been fully read.public boolean getFireCompletedEvent()
ProgressEvent.COMPLETED_EVENT_CODE
when this stream runs out of
data. By default, completed events are not fired by this stream.public int read() throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class FilterInputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in class FilterInputStream
IOException
Copyright © 2017. All Rights Reserved.