remove method

This commit is contained in:
Looly 2024-07-19 16:04:02 +08:00
parent bbbe8d069f
commit 2384ea0425

View File

@ -131,7 +131,7 @@ public class NioUtil {
* @since 4.5.0 * @since 4.5.0
*/ */
public static long copy(final ReadableByteChannel in, final WritableByteChannel out, final int bufferSize) throws IORuntimeException { public static long copy(final ReadableByteChannel in, final WritableByteChannel out, final int bufferSize) throws IORuntimeException {
return copy(in, out, bufferSize, null); return copy(in, out, bufferSize, -1, null);
} }
/** /**
@ -140,30 +140,16 @@ public class NioUtil {
* @param in {@link ReadableByteChannel} * @param in {@link ReadableByteChannel}
* @param out {@link WritableByteChannel} * @param out {@link WritableByteChannel}
* @param bufferSize 缓冲大小如果小于等于0使用默认 * @param bufferSize 缓冲大小如果小于等于0使用默认
* @param streamProgress {@link StreamProgress}进度处理器 * @param totalCount 读取总长度
* @return 拷贝的字节数
* @throws IORuntimeException IO异常
*/
public static long copy(final ReadableByteChannel in, final WritableByteChannel out, final int bufferSize, final StreamProgress streamProgress) throws IORuntimeException {
return copy(in, out, bufferSize, -1, streamProgress);
}
/**
* 拷贝流使用NIO不会关闭channel
*
* @param in {@link ReadableByteChannel}
* @param out {@link WritableByteChannel}
* @param bufferSize 缓冲大小如果小于等于0使用默认
* @param count 读取总长度
* @param streamProgress {@link StreamProgress}进度处理器 * @param streamProgress {@link StreamProgress}进度处理器
* @return 拷贝的字节数 * @return 拷贝的字节数
* @throws IORuntimeException IO异常 * @throws IORuntimeException IO异常
* @since 5.7.8 * @since 5.7.8
*/ */
public static long copy(final ReadableByteChannel in, final WritableByteChannel out, final int bufferSize, final long count, final StreamProgress streamProgress) throws IORuntimeException { public static long copy(final ReadableByteChannel in, final WritableByteChannel out, final int bufferSize, final long totalCount, final StreamProgress streamProgress) throws IORuntimeException {
Assert.notNull(in, "In channel is null!"); Assert.notNull(in, "In channel is null!");
Assert.notNull(out, "Out channel is null!"); Assert.notNull(out, "Out channel is null!");
return new ChannelCopier(bufferSize, count, streamProgress).copy(in, out); return new ChannelCopier(bufferSize, totalCount, streamProgress).copy(in, out);
} }
/** /**