S
- 拷贝源类型,如InputStream、Reader等T
- 拷贝目标类型,如OutputStream、Writer等public abstract class IoCopier<S,T> extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
bufferSize |
protected long |
count
拷贝总数
|
protected boolean |
flushEveryBuffer
是否每次写出一个buffer内容就执行flush
|
protected StreamProgress |
progress
进度条
|
Constructor and Description |
---|
IoCopier(int bufferSize,
long count,
StreamProgress progress)
构造
|
Modifier and Type | Method and Description |
---|---|
protected int |
bufferSize(long count)
缓存大小,取默认缓存和目标长度最小值
|
abstract long |
copy(S source,
T target)
执行拷贝
|
IoCopier<S,T> |
setFlushEveryBuffer(boolean flushEveryBuffer)
设置是否每次写出一个buffer内容就执行flush
|
protected final int bufferSize
protected final long count
protected StreamProgress progress
protected boolean flushEveryBuffer
public IoCopier(int bufferSize, long count, StreamProgress progress)
bufferSize
- 缓存大小,< 0 表示默认NioUtil.DEFAULT_BUFFER_SIZE
count
- 拷贝总数,-1表示无限制progress
- 进度条Copyright © 2024. All rights reserved.