本文整理了Java中org.apache.tools.zip.ZipEntry.setSize()
方法的一些代码示例,展示了ZipEntry.setSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipEntry.setSize()
方法的具体详情如下:
包路径:org.apache.tools.zip.ZipEntry
类名称:ZipEntry
方法名:setSize
[英]Sets the uncompressed size of the entry data.
[中]设置输入数据的未压缩大小。
代码示例来源:origin: org.apache.ant/ant
/**
* Creates a new zip entry taking some information from the given
* file and using the provided name.
*
* <p>The name will be adjusted to end with a forward slash "/" if
* the file is a directory. If the file is not a directory a
* potential trailing forward slash will be stripped from the
* entry name.</p>
*
* @param inputFile File
* @param entryName String
*/
public ZipEntry(final File inputFile, final String entryName) {
this(inputFile.isDirectory() && !entryName.endsWith("/") ? entryName + "/" : entryName);
if (inputFile.isFile()) {
setSize(inputFile.length());
}
setTime(inputFile.lastModified());
// TODO are there any other fields we can set here?
}
代码示例来源:origin: org.apache.ant/ant
} while (count != -1);
markableInputStream.reset();
ze.setSize(size);
ze.setCrc(cal.getValue());
代码示例来源:origin: org.apache.ant/ant
entry.entry.setSize(entry.bytesRead);
entry.entry.setCompressedSize(bytesWritten);
entry.entry.setCrc(crc);
entry.entry.setSize(bytesWritten);
entry.entry.setCompressedSize(bytesWritten);
entry.entry.setCrc(crc);
代码示例来源:origin: org.apache.ant/ant
ze.setTime(System.currentTimeMillis() + millisToAdd);
ze.setSize(0);
ze.setMethod(ZipEntry.STORED);
代码示例来源:origin: org.apache.ant/ant
ze.setSize(z64.getSize().getLongValue());
} else if (hasCompressedSize) {
z64.setSize(new ZipEightByteInteger(ze.getSize()));
代码示例来源:origin: hyperic/hq
private void addFile (org.apache.tools.zip.ZipEntry entry,
ZipOutputStream zip_out,
InputStream in,
long size,
byte[] buf) throws IOException {
entry.setTime(System.currentTimeMillis());
entry.setSize(size);
zip_out.putNextEntry(entry);
FileUtil.copyStream(in, zip_out, buf);
zip_out.closeEntry();
}
}
代码示例来源:origin: com.github.javahaohao/utils
ze.setSize(file.length());
ze.setTime(file.lastModified());
ze.setSize(f.length());
ze.setTime(f.lastModified());
内容来源于网络,如有侵权,请联系作者删除!