gpt4 book ai didi

net.lingala.zip4j.core.ZipFile.addStream()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 14:26:40 28 4
gpt4 key购买 nike

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

ZipFile.addStream介绍

[英]Creates a new entry in the zip file and adds the content of the inputstream to the zip file. ZipParameters.isSourceExternalStream and ZipParameters.fileNameInZip have to be set before in the input parameters. If the file name ends with / or , this method treats the content as a directory. Setting the flag ProgressMonitor.setRunInThread to true will have no effect for this method and hence this method cannot be used to add content to zip in thread mode
[中]在zip文件中创建一个新条目,并将inputstream的内容添加到zip文件中。ZipParameters。iSourceExternalStream和ZipParameters。必须在输入参数中设置fileNameInZip。如果文件名以/或\结尾,此方法将内容视为目录。在监视器上设置标志。将RunInthread设置为true对该方法无效,因此不能使用该方法在线程模式下向zip添加内容

代码示例

代码示例来源:origin: io.macgyver/macgyver-core

zp.setFileNameInZip(it.getName().replace(".",
      "/") + ".class");
  z.addStream(new ByteArrayInputStream(b), zp);
} catch (IOException | net.lingala.zip4j.exception.ZipException e) {
  throw new RuntimeException(e);

代码示例来源:origin: com.tomitribe.tribestream/tribestream-container

parameters.setSourceExternalStream(true);
  parameters.setFileNameInZip(c.name);
  zip.addStream(stream, parameters);
} catch (final IOException e) { // more than unlikely
  throw new IllegalStateException(e);

代码示例来源:origin: MCMrARM/revolution-irc

zipFile.addStream(exportPreferencesToJson(context), params);
  SettingsHelper.getGson().toJson(data, writer);
  params.setFileNameInZip(BACKUP_SERVER_PREFIX + data.uuid + BACKUP_SERVER_SUFFIX);
  zipFile.addStream(new ByteArrayInputStream(writer.toString().getBytes()), params);
  File sslCertsFile = configManager.getServerSSLCertsFile(data.uuid);
  if (sslCertsFile.exists()) {
NotificationRuleManager.saveUserRuleSettings(context, writer);
params.setFileNameInZip(BACKUP_NOTIFICATION_RULES_PATH);
zipFile.addStream(new ByteArrayInputStream(writer.toString().getBytes()), params);
zipFile.addStream(new ByteArrayInputStream(writer.toString().getBytes()), params);

代码示例来源:origin: org.jboss.forge.addon/resources-impl

try (InputStream stream = resource.getResourceInputStream())
  getZipFile().addStream(stream, parameters);

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