本文整理了Java中com.googlecode.d2j.util.zip.ZipEntry.getSize()
方法的一些代码示例,展示了ZipEntry.getSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipEntry.getSize()
方法的具体详情如下:
包路径:com.googlecode.d2j.util.zip.ZipEntry
类名称:ZipEntry
方法名:getSize
[英]Gets the uncompressed size of this android.ZipEntry.
[中]获取此android的未压缩大小。齐彭特里。
代码示例来源:origin: pxb1988/dex2jar
@Override
public int available() throws IOException {
return super.available() == 0 ? 0 : (int) (entry.getSize() - bytesRead);
}
}
代码示例来源:origin: pxb1988/dex2jar
/**
* Returns an input stream on the data of the specified {@code android.ZipEntry}.
*
* @param entry
* the android.ZipEntry.
* @return an input stream of the data contained in the {@code android.ZipEntry}.
* @throws java.io.IOException
* if an {@code IOException} occurs.
* @throws IllegalStateException
* if this zip file has been closed.
*/
public InputStream getInputStream(ZipEntry entry) throws IOException {
long entryDataStart = getEntryDataStart(entry);
ByteBuffer is = (ByteBuffer) raf.duplicate().position((int) entryDataStart);
if (entry.compressionMethod == ZipEntry.STORED) {
final ByteBuffer buf = (ByteBuffer) is.slice().order(ByteOrder.LITTLE_ENDIAN).limit((int) entry.size);
return new ByteBufferBackedInputStream(buf);
} else {
final ByteBuffer buf = (ByteBuffer) is.slice().order(ByteOrder.LITTLE_ENDIAN)
.limit((int) entry.compressedSize);
int bufSize = Math.max(1024, (int) Math.min(entry.getSize(), 65535L));
return new ZipInflaterInputStream(new ByteBufferBackedInputStream(buf), new Inflater(true), bufSize, entry);
}
}
代码示例来源:origin: SparkInLee/dexdiff
@Override
public int available() throws IOException {
return super.available() == 0 ? 0 : (int) (entry.getSize() - bytesRead);
}
}
代码示例来源:origin: SparkInLee/dexdiff
/**
* Returns an input stream on the data of the specified {@code android.ZipEntry}.
*
* @param entry
* the android.ZipEntry.
* @return an input stream of the data contained in the {@code android.ZipEntry}.
* @throws java.io.IOException
* if an {@code IOException} occurs.
* @throws IllegalStateException
* if this zip file has been closed.
*/
public InputStream getInputStream(ZipEntry entry) throws IOException {
long entryDataStart = getEntryDataStart(entry);
ByteBuffer is = (ByteBuffer) raf.duplicate().position((int) entryDataStart);
if (entry.compressionMethod == ZipEntry.STORED) {
final ByteBuffer buf = (ByteBuffer) is.slice().order(ByteOrder.LITTLE_ENDIAN).limit((int) entry.size);
return new ByteBufferBackedInputStream(buf);
} else {
final ByteBuffer buf = (ByteBuffer) is.slice().order(ByteOrder.LITTLE_ENDIAN)
.limit((int) entry.compressedSize);
int bufSize = Math.max(1024, (int) Math.min(entry.getSize(), 65535L));
return new ZipInflaterInputStream(new ByteBufferBackedInputStream(buf), new Inflater(true), bufSize, entry);
}
}
内容来源于网络,如有侵权,请联系作者删除!