gpt4 book ai didi

de.idyl.winzipaes.impl.ZipFileEntryInputStream类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 10:43:58 26 4
gpt4 key购买 nike

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

ZipFileEntryInputStream介绍

[英]Provide InputStream access to compressed data from one ZipEntry contained within one ZipFile. Necessary as java.util.zip.ZipInputStream only provides access to the uncompressed data.
[中]提供从一个ZipFile中包含的一个ZipPentry对压缩数据的InputStream访问。就像java一样必要。util。拉链ZipInputStream只提供对未压缩数据的访问。

代码示例

代码示例来源:origin: redfish64/TinyTravelTracker

protected void add(ZipFile inFile, String password) throws IOException,
    UnsupportedEncodingException {
  ZipFileEntryInputStream zfe = new ZipFileEntryInputStream(inFile.getName());			
  try {
    Enumeration<? extends ZipEntry> en = inFile.entries();
    while (en.hasMoreElements()) {
      ZipEntry ze = en.nextElement();
      zfe.nextEntry(ze);
      add(ze, zfe, password);
    }
  } finally {
    zfe.close();
  }
}

代码示例来源:origin: redfish64/TinyTravelTracker

public int read( byte[] b ) throws IOException {
  return this.read(b, 0, b.length);
}

代码示例来源:origin: de.idyl/winzipaes

protected void add(ZipFile inFile, String password) throws IOException,
    UnsupportedEncodingException {
  ZipFileEntryInputStream zfe = new ZipFileEntryInputStream(inFile.getName());			
  try {
    Enumeration<? extends ZipEntry> en = inFile.entries();
    while (en.hasMoreElements()) {
      ZipEntry ze = en.nextElement();
      zfe.nextEntry(ze);
      add(ze, zfe, password);
    }
  } finally {
    zfe.close();
  }
}

代码示例来源:origin: de.idyl/winzipaes

public int read( byte[] b ) throws IOException {
  return this.read(b, 0, b.length);
}

代码示例来源:origin: redfish64/TinyTravelTracker

protected void add(ZipEntry zipEntry, ZipFileEntryInputStream zipData, String password)
    throws IOException, UnsupportedEncodingException {
  encrypter.init(password, 256);
  ExtZipEntry entry = new ExtZipEntry(zipEntry.getName());
  entry.setMethod(zipEntry.getMethod());
  entry.setSize(zipEntry.getSize());
  entry.setCompressedSize(zipEntry.getCompressedSize() + 28);
  entry.setTime(zipEntry.getTime());
  entry.initEncryptedEntry();
  zipOS.putNextEntry(entry);
  // ZIP-file data contains: 1. salt 2. pwVerification 3. encryptedContent 4. authenticationCode
  zipOS.writeBytes(encrypter.getSalt());
  zipOS.writeBytes(encrypter.getPwVerification());
  byte[] data = new byte[1024];
  int read = zipData.read(data);
  while (read != -1) {
    encrypter.encrypt(data, read);
    zipOS.writeBytes(data, 0, read);
    read = zipData.read(data);
  }
  byte[] finalAuthentication = encrypter.getFinalAuthentication();
  if (LOG.isLoggable(Level.FINE)) {
    LOG.fine("finalAuthentication=" + Arrays.toString(finalAuthentication) + " at pos="
        + zipOS.getWritten());
  }
  zipOS.writeBytes(finalAuthentication);
}

代码示例来源:origin: de.idyl/winzipaes

protected void add(ZipEntry zipEntry, ZipFileEntryInputStream zipData, String password)
    throws IOException, UnsupportedEncodingException {
  encrypter.init(password, 256);
  ExtZipEntry entry = new ExtZipEntry(zipEntry.getName());
  entry.setMethod(zipEntry.getMethod());
  entry.setSize(zipEntry.getSize());
  entry.setCompressedSize(zipEntry.getCompressedSize() + 28);
  entry.setTime(zipEntry.getTime());
  entry.initEncryptedEntry();
  zipOS.putNextEntry(entry);
  // ZIP-file data contains: 1. salt 2. pwVerification 3. encryptedContent 4. authenticationCode
  zipOS.writeBytes(encrypter.getSalt());
  zipOS.writeBytes(encrypter.getPwVerification());
  byte[] data = new byte[1024];
  int read = zipData.read(data);
  while (read != -1) {
    encrypter.encrypt(data, read);
    zipOS.writeBytes(data, 0, read);
    read = zipData.read(data);
  }
  byte[] finalAuthentication = encrypter.getFinalAuthentication();
  if (LOG.isLoggable(Level.FINE)) {
    LOG.fine("finalAuthentication=" + Arrays.toString(finalAuthentication) + " at pos="
        + zipOS.getWritten());
  }
  zipOS.writeBytes(finalAuthentication);
}

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