public class ByteTransferRateProgress extends ByteTransferProgress
Modifier and Type | Field and Description |
---|---|
protected boolean |
computeRate
是否计算实时速率
|
protected int |
interval
计算间隔 ms
|
protected long |
nowRate
当前速度 byte
|
Constructor and Description |
---|
ByteTransferRateProgress(long end) |
ByteTransferRateProgress(long start,
long end) |
Modifier and Type | Method and Description |
---|---|
ByteTransferRateProgress |
computeRate() |
ByteTransferRateProgress |
computeRate(int interval)
开启计算实时速率
|
long |
getNowRate() |
ByteTransferRateProgress |
rateAcceptor(Consumer<? super ByteTransferRateProgress> rateAcceptor)
进度回调
|
ByteTransferRateProgress |
rateExecutor(ExecutorService rateExecutor)
进度调度器
|
void |
start()
开始
|
accept, callback, endTime, finish, finish, getCurrent, getEnd, getEndTime, getProgress, getStart, getStartTime, isDone, isError, reset, setCurrent, setEnd, setStart, startTime, usedTime
protected boolean computeRate
protected int interval
protected volatile long nowRate
public ByteTransferRateProgress(long end)
public ByteTransferRateProgress(long start, long end)
public ByteTransferRateProgress computeRate()
public ByteTransferRateProgress computeRate(int interval)
interval
- 间隔public ByteTransferRateProgress rateExecutor(ExecutorService rateExecutor)
rateExecutor
- 线程池public ByteTransferRateProgress rateAcceptor(Consumer<? super ByteTransferRateProgress> rateAcceptor)
rateAcceptor
- acceptorpublic void start()
Progress
start
in interface Progress
start
in class ByteTransferProgress
public long getNowRate()
Copyright © 2024. All rights reserved.