gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-17 07:04:40 26 4
gpt4 key购买 nike

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

ZipArchiveEntry.mergeExtraFields介绍

[英]If there are no extra fields, use the given fields as new extra data - otherwise merge the fields assuming the existing fields and the new fields stem from different locations inside the archive.
[中]如果没有额外字段,请将给定字段用作新的额外数据——否则,假设现有字段和新字段来自存档中的不同位置,则合并字段。

代码示例

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

/**
 * Sets the central directory part of extra fields.
 * @param b an array of bytes to be parsed into extra fields
 */
public void setCentralDirectoryExtra(final byte[] b) {
  try {
    final ZipExtraField[] central =
      ExtraFieldUtils.parse(b, false,
                 ExtraFieldUtils.UnparseableExtraField.READ);
    mergeExtraFields(central, false);
  } catch (final ZipException e) {
    throw new RuntimeException(e.getMessage(), e); //NOSONAR
  }
}

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

/**
 * Parses the given bytes as extra field data and consumes any
 * unparseable data as an {@link UnparseableExtraFieldData}
 * instance.
 * @param extra an array of bytes to be parsed into extra fields
 * @throws RuntimeException if the bytes cannot be parsed
 * @throws RuntimeException on error
 */
@Override
public void setExtra(final byte[] extra) throws RuntimeException {
  try {
    final ZipExtraField[] local =
      ExtraFieldUtils.parse(extra, true,
                 ExtraFieldUtils.UnparseableExtraField.READ);
    mergeExtraFields(local, true);
  } catch (final ZipException e) {
    // actually this is not possible as of Commons Compress 1.1
    throw new RuntimeException("Error parsing extra fields for entry: " //NOSONAR
                  + getName() + " - " + e.getMessage(), e);
  }
}

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

/**
 * Sets the central directory part of extra fields.
 * @param b an array of bytes to be parsed into extra fields
 */
public void setCentralDirectoryExtra(final byte[] b) {
  try {
    final ZipExtraField[] central =
      ExtraFieldUtils.parse(b, false,
                 ExtraFieldUtils.UnparseableExtraField.READ);
    mergeExtraFields(central, false);
  } catch (final ZipException e) {
    throw new RuntimeException(e.getMessage(), e); //NOSONAR
  }
}

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

/**
 * Parses the given bytes as extra field data and consumes any
 * unparseable data as an {@link UnparseableExtraFieldData}
 * instance.
 * @param extra an array of bytes to be parsed into extra fields
 * @throws RuntimeException if the bytes cannot be parsed
 * @throws RuntimeException on error
 */
@Override
public void setExtra(final byte[] extra) throws RuntimeException {
  try {
    final ZipExtraField[] local =
      ExtraFieldUtils.parse(extra, true,
                 ExtraFieldUtils.UnparseableExtraField.READ);
    mergeExtraFields(local, true);
  } catch (final ZipException e) {
    // actually this is not possible as of Commons Compress 1.1
    throw new RuntimeException("Error parsing extra fields for entry: " //NOSONAR
                  + getName() + " - " + e.getMessage(), e);
  }
}

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