aQute.bnd.osgi.Jar.setCompression()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(89)

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

Jar.setCompression介绍

暂无

代码示例

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

public void doChecksums(OutputStream out) throws Exception {
  // ok, we have a request to create digests
  // of the resources. Since we have to output
  // the manifest first, we have a slight problem.
  // We can also not make multiple passes over the resource
  // because some resources are not idempotent and/or can
  // take significant time. So we just copy the jar
  // to a temporary file, read it in again, calculate
  // the checksums and save.
  String[] algs = algorithms;
  algorithms = null;
  try {
    File f = File.createTempFile(padString(getName(), 3, '_'), ".jar");
    write(f);
    try (Jar tmp = new Jar(f)) {
      tmp.setCompression(compression);
      tmp.calcChecksums(algorithms);
      tmp.write(out);
    } finally {
      IO.delete(f);
    }
  } finally {
    algorithms = algs;
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

public void doChecksums(OutputStream out) throws Exception {
  // ok, we have a request to create digests
  // of the resources. Since we have to output
  // the manifest first, we have a slight problem.
  // We can also not make multiple passes over the resource
  // because some resources are not idempotent and/or can
  // take significant time. So we just copy the jar
  // to a temporary file, read it in again, calculate
  // the checksums and save.
  String[] algs = algorithms;
  algorithms = null;
  try {
    File f = File.createTempFile(padString(getName(), 3, '_'), ".jar");
    write(f);
    try (Jar tmp = new Jar(f)) {
      tmp.setCompression(compression);
      tmp.calcChecksums(algorithms);
      tmp.write(out);
    } finally {
      IO.delete(f);
    }
  } finally {
    algorithms = algs;
  }
}

代码示例来源:origin: biz.aQute.bnd/bnd

jar.setCompression(Jar.Compression.STORE);

相关文章

微信公众号

最新文章

更多