public class SyncInputStream extends FilterInputStream
in
Constructor and Description |
---|
SyncInputStream(InputStream in,
long length,
boolean isAsync,
boolean isIgnoreEOFError)
|
Modifier and Type | Method and Description |
---|---|
long |
copyTo(OutputStream out,
StreamProgress streamProgress)
将流的内容拷贝到输出流,拷贝结束后关闭输入流
|
byte[] |
readBytes()
读取流中所有bytes
|
SyncInputStream |
sync()
同步数据到内存,同步后关闭原流
|
available, close, mark, markSupported, read, read, read, reset, skip
public SyncInputStream(InputStream in, long length, boolean isAsync, boolean isIgnoreEOFError)
in
- 数据流length
- 限定长度,-1表示未知长度isAsync
- 是否异步isIgnoreEOFError
- 是否忽略EOF错误,在Http协议中,对于Transfer-Encoding: Chunked在正常情况下末尾会写入一个Length为0的的chunk标识完整结束public SyncInputStream sync()
public byte[] readBytes()
public long copyTo(OutputStream out, StreamProgress streamProgress)
out
- 输出流streamProgress
- 进度条Copyright © 2025. All rights reserved.