Package org.aoju.bus.core.io.copier
Class FileChannelCopier
java.lang.Object
org.aoju.bus.core.io.copier.IoCopier<FileChannel,FileChannel>
org.aoju.bus.core.io.copier.FileChannelCopier
-
Field Summary
Fields inherited from class org.aoju.bus.core.io.copier.IoCopier
bufferSize, count, flushEveryBuffer, progress -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcopy(FileInputStream in, FileOutputStream out) 拷贝文件流,使用NIOlongcopy(FileChannel source, FileChannel target) 执行拷贝Methods inherited from class org.aoju.bus.core.io.copier.IoCopier
bufferSize, setFlushEveryBuffer
-
Constructor Details
-
FileChannelCopier
public FileChannelCopier(long count) 构造- Parameters:
count- 拷贝总数,-1表示无限制
-
-
Method Details
-
copy
拷贝文件流,使用NIO- Parameters:
in- 输入out- 输出- Returns:
- 拷贝的字节数
-
copy
Description copied from class:IoCopier执行拷贝- Specified by:
copyin classIoCopier<FileChannel,FileChannel> - Parameters:
source- 拷贝源,如InputStream、Reader等target- 拷贝目标,如OutputStream、Writer等- Returns:
- 拷贝的实际长度
-