- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setCrc()
方法的一些代码示例,展示了ZipArchiveEntry.setCrc()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipArchiveEntry.setCrc()
方法的具体详情如下:
包路径:org.apache.commons.compress.archivers.zip.ZipArchiveEntry
类名称:ZipArchiveEntry
方法名:setCrc
暂无
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Update the original {@link ZipArchiveEntry} with sizes/crc
* Do not use this methods from threads that did not create the instance itself !
* @return the zipArchiveEntry that is basis for this request
*/
public ZipArchiveEntry transferToArchiveEntry(){
final ZipArchiveEntry entry = zipArchiveEntryRequest.getZipArchiveEntry();
entry.setCompressedSize(compressedSize);
entry.setSize(size);
entry.setCrc(crc);
entry.setMethod(zipArchiveEntryRequest.getMethod());
return entry;
}
}
代码示例来源:origin: plutext/docx4j
ze.setCrc(crc.getValue());
代码示例来源:origin: org.apache.commons/commons-compress
entry.entry.setCrc(crc);
entry.entry.setSize(bytesWritten);
entry.entry.setCompressedSize(bytesWritten);
entry.entry.setCrc(crc);
代码示例来源:origin: org.apache.commons/commons-compress
private void readDataDescriptor() throws IOException {
readFully(wordBuf);
ZipLong val = new ZipLong(wordBuf);
if (ZipLong.DD_SIG.equals(val)) {
// data descriptor with signature, skip sig
readFully(wordBuf);
val = new ZipLong(wordBuf);
}
current.entry.setCrc(val.getValue());
// if there is a ZIP64 extra field, sizes are eight bytes
// each, otherwise four bytes each. Unfortunately some
// implementations - namely Java7 - use eight bytes without
// using a ZIP64 extra field -
// https://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7073588
// just read 16 bytes and check whether bytes nine to twelve
// look like one of the signatures of what could follow a data
// descriptor (ignoring archive decryption headers for now).
// If so, push back eight bytes and assume sizes are four
// bytes, otherwise sizes are eight bytes each.
readFully(twoDwordBuf);
final ZipLong potentialSig = new ZipLong(twoDwordBuf, DWORD);
if (potentialSig.equals(ZipLong.CFH_SIG) || potentialSig.equals(ZipLong.LFH_SIG)) {
pushback(twoDwordBuf, DWORD, DWORD);
current.entry.setCompressedSize(ZipLong.getValue(twoDwordBuf));
current.entry.setSize(ZipLong.getValue(twoDwordBuf, WORD));
} else {
current.entry.setCompressedSize(ZipEightByteInteger.getLongValue(twoDwordBuf));
current.entry.setSize(ZipEightByteInteger.getLongValue(twoDwordBuf, DWORD));
}
}
代码示例来源:origin: org.apache.commons/commons-compress
current.entry.setCrc(ZipLong.getValue(lfhBuf, off));
off += WORD;
代码示例来源:origin: org.codehaus.plexus/plexus-archiver
ze.setMethod( ZipArchiveEntry.STORED );
ze.setCrc( EMPTY_CRC );
代码示例来源:origin: com.haulmont.reports/reports-core
protected ArchiveEntry newStoredEntry(String name, byte[] data) {
ZipArchiveEntry zipEntry = new ZipArchiveEntry(name);
zipEntry.setSize(data.length);
zipEntry.setCompressedSize(zipEntry.getSize());
CRC32 crc32 = new CRC32();
crc32.update(data);
zipEntry.setCrc(crc32.getValue());
return zipEntry;
}
代码示例来源:origin: com.haulmont.cuba/cuba-core
protected ArchiveEntry newStoredEntry(String name, byte[] data) {
ZipArchiveEntry zipEntry = new ZipArchiveEntry(name);
zipEntry.setSize(data.length);
zipEntry.setCompressedSize(zipEntry.getSize());
CRC32 crc32 = new CRC32();
crc32.update(data);
zipEntry.setCrc(crc32.getValue());
return zipEntry;
}
代码示例来源:origin: com.haulmont.reports/reports-core
protected ArchiveEntry newStoredEntry(String name, byte[] data) {
ZipArchiveEntry zipEntry = new ZipArchiveEntry(name);
zipEntry.setSize(data.length);
zipEntry.setCompressedSize(zipEntry.getSize());
CRC32 crc32 = new CRC32();
crc32.update(data);
zipEntry.setCrc(crc32.getValue());
return zipEntry;
}
代码示例来源:origin: com.haulmont.cuba/cuba-global
private static ArchiveEntry newTailArchive(String name, byte[] tail) {
ZipArchiveEntry zipEntry = new ZipArchiveEntry(name);
zipEntry.setSize(tail.length);
zipEntry.setCompressedSize(zipEntry.getSize());
CRC32 crc32 = new CRC32();
crc32.update(tail);
zipEntry.setCrc(crc32.getValue());
return zipEntry;
}
代码示例来源:origin: com.haulmont.cuba/cuba-core
protected ArchiveEntry newStoredEntry(String name, byte[] data) {
ZipArchiveEntry zipEntry = new ZipArchiveEntry(name);
zipEntry.setSize(data.length);
zipEntry.setCompressedSize(zipEntry.getSize());
CRC32 crc32 = new CRC32();
crc32.update(data);
zipEntry.setCrc(crc32.getValue());
return zipEntry;
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-global
private static ArchiveEntry newArchive(File file) throws IOException {
ZipArchiveEntry zipEntry = new ZipArchiveEntry(file.getName());
zipEntry.setSize(file.length());
zipEntry.setCompressedSize(zipEntry.getSize());
zipEntry.setCrc(FileUtils.checksumCRC32(file));
return zipEntry;
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Update the original {@link ZipArchiveEntry} with sizes/crc
* Do not use this methods from threads that did not create the instance itself !
* @return the zipArchiveEntry that is basis for this request
*/
public ZipArchiveEntry transferToArchiveEntry(){
final ZipArchiveEntry entry = zipArchiveEntryRequest.getZipArchiveEntry();
entry.setCompressedSize(compressedSize);
entry.setSize(size);
entry.setCrc(crc);
entry.setMethod(zipArchiveEntryRequest.getMethod());
return entry;
}
}
代码示例来源:origin: org.docx4j/docx4j
ze.setCrc(crc.getValue());
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
entry.entry.setCrc(crc);
entry.entry.setSize(bytesWritten);
entry.entry.setCompressedSize(bytesWritten);
entry.entry.setCrc(crc);
代码示例来源:origin: de.unkrig/de-unkrig-commons
@Override public void
writeEntry(
ArchiveOutputStream archiveOutputStream,
ArchiveEntry archiveEntry,
@Nullable String name,
ConsumerWhichThrows<? super OutputStream, ? extends IOException> writeContents
) throws IOException {
if (!(archiveOutputStream instanceof ZipArchiveOutputStream)) {
throw new IllegalArgumentException(archiveOutputStream.getClass().getName());
}
ZipArchiveEntry nzae = new ZipArchiveEntry(name != null ? name : archiveEntry.getName());
nzae.setTime(archiveEntry.getLastModifiedDate().getTime());
if (archiveEntry instanceof ZipArchiveEntry) {
ZipArchiveEntry zae = (ZipArchiveEntry) archiveEntry;
nzae.setComment(zae.getComment());
nzae.setExternalAttributes(zae.getExternalAttributes());
nzae.setExtraFields(zae.getExtraFields(true));
nzae.setGeneralPurposeBit(zae.getGeneralPurposeBit());
nzae.setInternalAttributes(zae.getInternalAttributes());
nzae.setMethod(zae.getMethod());
if (nzae.isDirectory()) {
nzae.setSize(0);
nzae.setCrc(0);
}
}
archiveOutputStream.putArchiveEntry(nzae);
if (!archiveEntry.isDirectory()) writeContents.consume(archiveOutputStream);
archiveOutputStream.closeArchiveEntry();
}
代码示例来源:origin: de.unkrig.commons/commons-file
@Override public void
writeEntry(
ArchiveOutputStream archiveOutputStream,
ArchiveEntry archiveEntry,
@Nullable String name,
ConsumerWhichThrows<? super OutputStream, ? extends IOException> writeContents
) throws IOException {
if (!(archiveOutputStream instanceof ZipArchiveOutputStream)) {
throw new IllegalArgumentException(archiveOutputStream.getClass().getName());
}
ZipArchiveEntry nzae = new ZipArchiveEntry(name != null ? name : archiveEntry.getName());
nzae.setTime(archiveEntry.getLastModifiedDate().getTime());
if (archiveEntry instanceof ZipArchiveEntry) {
ZipArchiveEntry zae = (ZipArchiveEntry) archiveEntry;
nzae.setComment(zae.getComment());
nzae.setExternalAttributes(zae.getExternalAttributes());
nzae.setExtraFields(zae.getExtraFields(true));
nzae.setGeneralPurposeBit(zae.getGeneralPurposeBit());
nzae.setInternalAttributes(zae.getInternalAttributes());
nzae.setMethod(zae.getMethod());
if (nzae.isDirectory()) {
nzae.setSize(0);
nzae.setCrc(0);
}
}
archiveOutputStream.putArchiveEntry(nzae);
if (!archiveEntry.isDirectory()) writeContents.consume(archiveOutputStream);
archiveOutputStream.closeArchiveEntry();
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
private void readDataDescriptor() throws IOException {
readFully(wordBuf);
ZipLong val = new ZipLong(wordBuf);
if (ZipLong.DD_SIG.equals(val)) {
// data descriptor with signature, skip sig
readFully(wordBuf);
val = new ZipLong(wordBuf);
}
current.entry.setCrc(val.getValue());
// if there is a ZIP64 extra field, sizes are eight bytes
// each, otherwise four bytes each. Unfortunately some
// implementations - namely Java7 - use eight bytes without
// using a ZIP64 extra field -
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7073588
// just read 16 bytes and check whether bytes nine to twelve
// look like one of the signatures of what could follow a data
// descriptor (ignoring archive decryption headers for now).
// If so, push back eight bytes and assume sizes are four
// bytes, otherwise sizes are eight bytes each.
readFully(twoDwordBuf);
final ZipLong potentialSig = new ZipLong(twoDwordBuf, DWORD);
if (potentialSig.equals(ZipLong.CFH_SIG) || potentialSig.equals(ZipLong.LFH_SIG)) {
pushback(twoDwordBuf, DWORD, DWORD);
current.entry.setCompressedSize(ZipLong.getValue(twoDwordBuf));
current.entry.setSize(ZipLong.getValue(twoDwordBuf, WORD));
} else {
current.entry.setCompressedSize(ZipEightByteInteger.getLongValue(twoDwordBuf));
current.entry.setSize(ZipEightByteInteger.getLongValue(twoDwordBuf, DWORD));
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
current.entry.setCrc(ZipLong.getValue(lfhBuf, off));
off += WORD;
我必须使用 apache-commons-compress-1.x API 创建一个 zip 文件。我使用了以下代码: File fileZip = new File("D:\\file.zip");
我正在使用 .Net 4.5.2 System.IO.Compression.ZipArchive 类处理一些第 3 方 ZIP 文件,并且一切正常。 但是,我需要区分文件条目和目录条目,最好不要先提
如何覆盖 ZipArchiveEntry 的内容?如果新文件内容比原始文件内容短,则以下使用 StreamWriter 和 StringBuilder 的代码将失败,例如: using System.
我正在设备上运行一项服务,并想将文件发送到该服务。很简单,但我要发送的文件来自一个 zip 文件,这对我来说变得复杂了。我试图通过将内部文件流发送到设备来实现我的目标,但后来我不得不意识到我正在发送
使用 ASP.NET Framework 4.7.1,我尝试压缩文件,但 Visual Studio 显示 ZipArchiveEntry不包含ExtractToFile的定义. 这是我的代码: [H
我正在尝试获取 ZipArchiveEntry 的列表并将它们转换为字节数组,但我在逻辑上遇到了困难。 到目前为止,我正在尝试将其转换为 MemoryStream 以将其转换为 byte[],如下所示
.NET ZipArchive 是否允许重命名或移动条目?目前无法更改 ZipArchiveEntry 创建后的名称。看来我必须将原始 ZipArchiveEntry 的流复制到名称更改后的新 Zip
我正在尝试弄清楚如何创建包含具有不同扩展名的文件的 zip 存档,例如.txt 文件、.html 文件 如果我执行以下操作: using (var zipArchive = new ZipArchiv
我正在尝试使用以下代码将大型视频文件 (~500MB) 添加到 ArchiveEntry: using (var zipFile = ZipFile.Open(outputZipFile, ZipAr
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setNameSource()方法的一些代码示例,展示了ZipA
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.getAllExtraFieldsNoCopy()方法的一些代码
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.getAllExtraFields()方法的一些代码示例,展示了
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.getMergedFields()方法的一些代码示例,展示了Zi
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setDataOffset()方法的一些代码示例,展示了ZipA
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setCommentSource()方法的一些代码示例,展示了Z
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.getLocalHeaderOffset()方法的一些代码示例,
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.getLastModifiedDate()方法的一些代码示例,展
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setLocalHeaderOffset()方法的一些代码示例,
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.getParseableExtraFieldsNoCopy()方
本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.hashCode()方法的一些代码示例,展示了ZipArchiv
我是一名优秀的程序员,十分优秀!