Package com.imyeyu.compress
Class ZipCompressor
- All Implemented Interfaces:
com.imyeyu.utils.OS.FileSystem
Zip 压缩器
- Version:
- 2024-06-30 19:46
- Author:
- 夜雨
-
Field Summary
Fields inherited from class com.imyeyu.compress.AbstractRunner
fileCallback, isInterrupt, isPause, pauseLock, progressCallbackFields inherited from interface com.imyeyu.utils.OS.FileSystem
COMPARATOR_FILE_NAME, SEP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ZipCompressor创建压缩器static ZipCompressor创建压缩器protected voidtoStream(String fromPath, OutputStream toStream) 执行压缩到输出流Methods inherited from class com.imyeyu.compress.Compressor
of, of, requireFromPath, toFile, toFile, toFile, toStreamMethods inherited from class com.imyeyu.compress.AbstractRunner
awaitIfPaused, ensureRunning, fileCallback, finishProgress, handleFile, handleProgress, handleTransferred, initByteProgress, interrupt, nonClosing, nonClosing, normalizeEntryName, pause, progressCallback, resetProgress, self, setFileCallback, setProgressCallback, start, transfer, transfer
-
Constructor Details
-
ZipCompressor
public ZipCompressor()
-
-
Method Details
-
from
创建压缩器- Parameters:
fromPath- 源路径- Returns:
- 压缩器
-
from
创建压缩器- Parameters:
fromFile- 源文件- Returns:
- 压缩器
-
toStream
Description copied from class:Compressor执行压缩到输出流- Specified by:
toStreamin classCompressor<ZipCompressor>- Parameters:
fromPath- 源路径toStream- 目标输出流- Throws:
Exception- 压缩失败
-