本文整理匯總了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.setUseZip64方法的典型用法代碼示例。如果您正苦於以下問題:Java ZipArchiveOutputStream.setUseZip64方法的具體用法?Java ZipArchiveOutputStream.setUseZip64怎麽用?Java ZipArchiveOutputStream.setUseZip64使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
的用法示例。
在下文中一共展示了ZipArchiveOutputStream.setUseZip64方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: compress
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; //導入方法依賴的package包/類
public void compress(File[] files, File zipFile) throws IOException {
if (files == null) {
return;
}
ZipArchiveOutputStream out = new ZipArchiveOutputStream(zipFile);
out.setUseZip64(Zip64Mode.AsNeeded);
// 將每個文件用ZipArchiveEntry封裝
for (File file : files) {
if (file == null) {
continue;
}
compressOneFile(file, out, "");
}
if (out != null) {
out.close();
}
}
示例2: makeArchiveOutputStream
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; //導入方法依賴的package包/類
@Override
public ArchiveOutputStream makeArchiveOutputStream(OutputStream stream)
throws IOException, ArchiveException {
ZipArchiveOutputStream zaos = new ZipArchiveOutputStream(stream);
zaos.setLevel(_compressionLevel);
zaos.setUseZip64(Zip64Mode.AsNeeded);
return zaos;
}
示例3: startExport
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; //導入方法依賴的package包/類
public void startExport()
{
// ALF-2016
zipStream = new ZipArchiveOutputStream(outputStream);
// NOTE: This encoding allows us to workaround bug...
// http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4820807
zipStream.setEncoding("UTF-8");
zipStream.setCreateUnicodeExtraFields(UnicodeExtraFieldPolicy.ALWAYS);
zipStream.setUseLanguageEncodingFlag(true);
zipStream.setFallbackToUTF8(true);
zipStream.setUseZip64(Zip64Mode.Always);
}