public class MeasuableInputStream extends FilterInputStream
in
Constructor and Description |
---|
MeasuableInputStream(String caller,
InputStream in,
OSSCallback ossCallback,
int totalSize)
构造一个可观测到读取进度的输入流。
|
MeasuableInputStream(String caller,
InputStream in,
OSSCallback ossCallback,
int current,
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(String caller, InputStream in, OSSCallback ossCallback, int totalSize)
caller
- 使用到这个流的OSSObject对象in
- 原输入流saveCallback
- 处理进度的回调方法,调用其中的onProgress接口进行进度处理totalSize
- 此输入流要输入的总字节数public MeasuableInputStream(String caller, InputStream in, OSSCallback ossCallback, int current, int totalSize)
caller
- 使用到这个流的OSSObject对象in
- 原输入流saveCallback
- 处理进度的回调方法,调用其中的onProgress接口进行进度处理current
- 此前已经处理的字节数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.