
com.magictools.core.io.StreamProgress Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of magic-tools-all Show documentation
Show all versions of magic-tools-all Show documentation
magic-tools 是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。
The newest version!
package com.magictools.core.io;
/**
* Stream进度条
* 提供流拷贝进度监测,如开始、结束触发,以及进度回调。
* 注意进度回调的{@code total}参数为总大小,某些场景下无总大小的标记,则此值应为-1或者{@link Long#MAX_VALUE},表示此参数无效。
*
* @author Looly
*/
public interface StreamProgress {
/**
* 开始
*/
void start();
/**
* 进行中
*
* @param total 总大小,如果未知为 -1或者{@link Long#MAX_VALUE}
* @param progressSize 已经进行的大小
*/
void progress(long total, long progressSize);
/**
* 结束
*/
void finish();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy