gpt4 book ai didi

com.googlecode.d2j.util.zip.ZipEntry.getSize()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 10:43:31 27 4
gpt4 key购买 nike

本文整理了Java中com.googlecode.d2j.util.zip.ZipEntry.getSize()方法的一些代码示例,展示了ZipEntry.getSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipEntry.getSize()方法的具体详情如下:
包路径:com.googlecode.d2j.util.zip.ZipEntry
类名称:ZipEntry
方法名:getSize

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);
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com