org.apache.commons.compress.archivers.zip.ZipFile.resolveLocalFileHeaderData()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(138)

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

ZipFile.resolveLocalFileHeaderData介绍

[英]Walks through all recorded entries and adds the data available from the local file header.

Also records the offsets for the data to read from the entries.
[中]浏览所有记录的条目,并添加本地文件头中可用的数据。
还记录要从条目中读取的数据的偏移量。

代码示例

代码示例来源:origin: org.apache.commons/commons-compress

private ZipFile(final SeekableByteChannel channel, final String archiveName,
        final String encoding, final boolean useUnicodeExtraFields,
        final boolean closeOnError)
  throws IOException {
  this.archiveName = archiveName;
  this.encoding = encoding;
  this.zipEncoding = ZipEncodingHelper.getZipEncoding(encoding);
  this.useUnicodeExtraFields = useUnicodeExtraFields;
  archive = channel;
  boolean success = false;
  try {
    final Map<ZipArchiveEntry, NameAndComment> entriesWithoutUTF8Flag =
      populateFromCentralDirectory();
    resolveLocalFileHeaderData(entriesWithoutUTF8Flag);
    success = true;
  } finally {
    closed = !success;
    if (!success && closeOnError) {
      IOUtils.closeQuietly(archive);
    }
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

private ZipFile(final SeekableByteChannel channel, final String archiveName,
        final String encoding, final boolean useUnicodeExtraFields,
        final boolean closeOnError)
  throws IOException {
  this.archiveName = archiveName;
  this.encoding = encoding;
  this.zipEncoding = ZipEncodingHelper.getZipEncoding(encoding);
  this.useUnicodeExtraFields = useUnicodeExtraFields;
  archive = channel;
  boolean success = false;
  try {
    final Map<ZipArchiveEntry, NameAndComment> entriesWithoutUTF8Flag =
      populateFromCentralDirectory();
    resolveLocalFileHeaderData(entriesWithoutUTF8Flag);
    success = true;
  } finally {
    closed = !success;
    if (!success && closeOnError) {
      IOUtils.closeQuietly(archive);
    }
  }
}

相关文章