本文整理了Java中de.schlichtherle.truezip.zip.ZipEntry.getSize()
方法的一些代码示例,展示了ZipEntry.getSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipEntry.getSize()
方法的具体详情如下:
包路径:de.schlichtherle.truezip.zip.ZipEntry
类名称:ZipEntry
方法名:getSize
[英]Returns the uncompressed size of this entry.
[中]返回此项的未压缩大小。
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
private static int getBufferSize(final ZipEntry entry) {
long size = entry.getSize();
if (MAX_FLATER_BUF_LENGTH < size)
size = MAX_FLATER_BUF_LENGTH;
else if (size < MIN_FLATER_BUF_LENGTH)
size = MIN_FLATER_BUF_LENGTH;
return (int) size;
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
final boolean isZip64ExtensionsRequired() {
// Offset MUST be considered in decision about ZIP64 format - see
// description of Data Descriptor in ZIP File Format Specification!
if (FORCE_ZIP64_EXT)
return true /*UNKNOWN != getCompressedSize()
|| UNKNOWN != getSize()
|| UNKNOWN != getOffset()*/;
else
return UInt.MAX_VALUE <= getCompressedSize()
|| UInt.MAX_VALUE <= getSize()
|| UInt.MAX_VALUE <= getOffset();
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
final boolean isDataDescriptorRequired() {
return UNKNOWN == (getCrc() | getCompressedSize() | getSize());
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
if (UNKNOWN != (value = getCompressedSize()))
f.format(", compressedSize=%d", value);
if (UNKNOWN != (value = getSize()))
f.format(", size=%d", value);
if (UNKNOWN != (value = getExternalAttributes()))
代码示例来源:origin: uk.gov.nationalarchives/droid-results
.hasMoreElements();) {
ZipEntry e = it.nextElement();
totalSize += e.getSize();
代码示例来源:origin: digital-preservation/droid
.hasMoreElements();) {
ZipEntry e = it.nextElement();
totalSize += e.getSize();
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
int off = 0;
final long size = getSize();
if (FORCE_ZIP64_EXT && UNKNOWN != size || UInt.MAX_VALUE <= size) {
writeLong(size, data, off);
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
@Test
public void testSize() {
try {
entry.setSize(UNKNOWN - 1);
fail();
} catch (IllegalArgumentException expected) {
}
try {
entry.setSize(ULong.MAX_VALUE + 1);
fail();
} catch (IllegalArgumentException expected) {
}
assertEquals(UNKNOWN, entry.getSize());
entry.setSize(UInt.MIN_VALUE);
assertEquals(UInt.MIN_VALUE, entry.getSize());
entry.setSize(UInt.MAX_VALUE);
assertEquals(UInt.MAX_VALUE, entry.getSize());
entry.setSize(UInt.MAX_VALUE + 1); // ZIP64!
assertEquals(UInt.MAX_VALUE + 1, entry.getSize());
entry.setSize(UNKNOWN);
assertEquals(UNKNOWN, entry.getSize());
}
代码示例来源:origin: uk.gov.nationalarchives/droid-core-interfaces
throws IOException {
long size = entry.getSize();
long time = entry.getTime();
代码示例来源:origin: digital-preservation/droid
/**
* @param parentName
* @param entry
* @param entryName
* @param correlationId
* @return
*/
private ResourceId submitDirectory(final URI parentName,
ZipEntry entry, String entryName, ResourceId correlationId) {
IdentificationResultImpl result = new IdentificationResultImpl();
long size = entry.getSize();
long time = entry.getTime();
RequestMetaData metaData = new RequestMetaData(
size != -1 ? size : null,
time != -1 ? time : null,
entryName);
RequestIdentifier identifier = new RequestIdentifier(
ArchiveFileUtils.toZipUri(parentName, entry.getName()));
result.setRequestMetaData(metaData);
result.setIdentifier(identifier);
return resultHandler.handleDirectory(result, correlationId, false);
}
代码示例来源:origin: digital-preservation/droid
throws IOException {
long size = entry.getSize();
long time = entry.getTime();
代码示例来源:origin: uk.gov.nationalarchives/droid-core-interfaces
/**
* @param parentName
* @param entry
* @param entryName
* @param correlationId
* @return
*/
private ResourceId submitDirectory(final URI parentName,
ZipEntry entry, String entryName, ResourceId correlationId) {
IdentificationResultImpl result = new IdentificationResultImpl();
long size = entry.getSize();
long time = entry.getTime();
RequestMetaData metaData = new RequestMetaData(
size != -1 ? size : null,
time != -1 ? time : null,
entryName);
RequestIdentifier identifier = new RequestIdentifier(
ArchiveFileUtils.toZipUri(parentName, entry.getName()));
result.setRequestMetaData(metaData);
result.setIdentifier(identifier);
return resultHandler.handleDirectory(result, correlationId, false);
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
assertEquals(data.length, entry.getSize());
assertTrue(set.remove(entry.getName()));
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
final String name = i + ".txt";
final ZipEntry entry = zipIn.getEntry(name);
assertEquals(data1.length, entry.getSize());
final InputStream in = zipIn.getInputStream(name);
try {
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
final ZipEntry entry = e.nextElement();
assertEquals(data.length, entry.getSize());
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
entry.setRawOffset(UInt.MAX_VALUE);
assertEquals(0x0fedcba987654321L, entry.getSize());
assertEquals(UInt.MAX_VALUE, entry.getRawSize());
assertEquals(0x0fedcba987654322L, entry.getCompressedSize());
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
throw new ZipException(entry.getName()
+ " (invalid compressed size in Data Descriptor)");
if (entry.getSize() != size)
throw new ZipException(entry.getName()
+ " (invalid uncompressed size in Data Descriptor)");
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
throws IOException {
final long csize = entry.getCompressedSize();
final long size = entry.getSize();
内容来源于网络,如有侵权,请联系作者删除!