fix comment

This commit is contained in:
Looly 2021-08-12 00:22:38 +08:00
parent 05c679bfc5
commit 1fbc6b61bd
3 changed files with 8 additions and 4 deletions

View File

@ -97,6 +97,7 @@ public class IoUtil extends NioUtil {
* @param reader Reader * @param reader Reader
* @param writer Writer * @param writer Writer
* @param bufferSize 缓存大小 * @param bufferSize 缓存大小
* @param count 最大长度
* @param streamProgress 进度处理器 * @param streamProgress 进度处理器
* @return 传输的byte数 * @return 传输的byte数
* @throws IORuntimeException IO异常 * @throws IORuntimeException IO异常

View File

@ -63,6 +63,7 @@ public class NioUtil {
* @param in 输入流 * @param in 输入流
* @param out 输出流 * @param out 输出流
* @param bufferSize 缓存大小 * @param bufferSize 缓存大小
* @param count 最大长度
* @param streamProgress 进度条 * @param streamProgress 进度条
* @return 传输的byte数 * @return 传输的byte数
* @throws IORuntimeException IO异常 * @throws IORuntimeException IO异常

View File

@ -28,9 +28,9 @@ public abstract class IoCopier<S, T> {
/** /**
* 构造 * 构造
* *
* @param bufferSize 缓存大小&lt; 0 表示默认{@link IoUtil#DEFAULT_BUFFER_SIZE} * @param bufferSize 缓存大小&lt; 0 表示默认{@link IoUtil#DEFAULT_BUFFER_SIZE}
* @param count 拷贝总数-1表示无限制 * @param count 拷贝总数-1表示无限制
* @param progress 进度条 * @param progress 进度条
*/ */
public IoCopier(int bufferSize, long count, StreamProgress progress) { public IoCopier(int bufferSize, long count, StreamProgress progress) {
this.bufferSize = bufferSize > 0 ? bufferSize : IoUtil.DEFAULT_BUFFER_SIZE; this.bufferSize = bufferSize > 0 ? bufferSize : IoUtil.DEFAULT_BUFFER_SIZE;
@ -49,9 +49,11 @@ public abstract class IoCopier<S, T> {
/** /**
* 缓存大小取默认缓存和目标长度最小值 * 缓存大小取默认缓存和目标长度最小值
*
* @param count 目标长度
* @return 缓存大小 * @return 缓存大小
*/ */
protected int bufferSize(long count) { protected int bufferSize(long count) {
return (int)Math.min(this.bufferSize, count); return (int) Math.min(this.bufferSize, count);
} }
} }