public class MeasuableInputStream extends FilterInputStream
in
Constructor and Description |
---|
MeasuableInputStream(InputStream in,
GenericProgressHandler handler,
int totalSize)
构造一个可观测到读取进度的输入流。
|
Modifier and Type | Method and Description |
---|---|
int |
read() |
int |
read(byte[] buffer) |
int |
read(byte[] buffer,
int byteOffset,
int byteCount) |
void |
setSwitch(AtomicBoolean isCancel) |
long |
skip(long byteCount) |
available, close, mark, markSupported, reset
public MeasuableInputStream(InputStream in, GenericProgressHandler handler, int totalSize)
in
- 原输入流handler
- 处理进度的回调方法,调用其中的onProgress接口进行进度处理totalSize
- 此输入流要输入的总字节数public void setSwitch(AtomicBoolean isCancel)
public int read() throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] buffer) throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException
read
in class FilterInputStream
IOException
public long skip(long byteCount) throws IOException
skip
in class FilterInputStream
IOException
Copyright © 2015. All rights reserved.