本文整理汇总了Java中org.apache.commons.compress.archivers.zip.Zip64Mode类的典型用法代码示例。如果您正苦于以下问题:Java Zip64Mode类的具体用法?Java Zip64Mode怎么用?Java Zip64Mode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Zip64Mode类属于org.apache.commons.compress.archivers.zip包,在下文中一共展示了Zip64Mode类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compress
import org.apache.commons.compress.archivers.zip.Zip64Mode; //导入依赖的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: startExport
import org.apache.commons.compress.archivers.zip.Zip64Mode; //导入依赖的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);
}
示例3: makeArchiveOutputStream
import org.apache.commons.compress.archivers.zip.Zip64Mode; //导入依赖的package包/类
@Override
public ArchiveOutputStream makeArchiveOutputStream(OutputStream stream)
throws IOException, ArchiveException {
ZipArchiveOutputStream zaos = new ZipArchiveOutputStream(stream);
zaos.setLevel(_compressionLevel);
zaos.setUseZip64(Zip64Mode.AsNeeded);
return zaos;
}
示例4: makeArchiveOutputStream
import org.apache.commons.compress.archivers.zip.Zip64Mode; //导入依赖的package包/类
@Override
public ArchiveOutputStream makeArchiveOutputStream(OutputStream stream)
throws IOException, ArchiveException {
JarArchiveOutputStream jaos = new JarArchiveOutputStream(stream);
jaos.setLevel(_compressionLevel);
jaos.setUseZip64(Zip64Mode.AsNeeded);
jaos.setFallbackToUTF8(true);
return jaos;
}