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

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

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

Jar.write介绍

[英]Convert a string to bytes with UTF8 and then output in max 72 bytes
[中]使用UTF8将字符串转换为字节,然后以最大72字节的格式输出

代码示例

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

  1. /**
  2. * Write out an entry, handling proper unicode and line length constraints
  3. */
  4. private static void writeEntry(OutputStream out, String name, String value) throws IOException {
  5. int n = write(out, 0, name + ": ");
  6. write(out, n, value);
  7. write(out, 0, "\r\n");
  8. }

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

  1. /**
  2. * Write out an entry, handling proper unicode and line length constraints
  3. */
  4. private static void writeEntry(OutputStream out, String name, String value) throws IOException {
  5. int n = write(out, 0, name + ": ");
  6. write(out, n, value);
  7. write(out, 0, "\r\n");
  8. }

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

  1. /**
  2. * Write out an entry, handling proper unicode and line length constraints
  3. */
  4. private static void writeEntry(OutputStream out, String name, String value) throws IOException {
  5. int n = write(out, 0, name + ": ");
  6. write(out, n, value);
  7. write(out, 0, "\r\n");
  8. }

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

  1. @Override
  2. public void write(OutputStream out) throws Exception {
  3. jar.write(out);
  4. }

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

  1. /**
  2. * Write out an entry, handling proper unicode and line length constraints
  3. */
  4. private static void writeEntry(OutputStream out, String name, String value) throws IOException {
  5. int width = write(out, 0, name);
  6. width = write(out, width, SEPARATOR);
  7. write(out, width, value);
  8. out.write(EOL);
  9. }

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

  1. /**
  2. * Write out an entry, handling proper unicode and line length constraints
  3. */
  4. private static void writeEntry(OutputStream out, String name, String value) throws IOException {
  5. int width = write(out, 0, name);
  6. width = write(out, width, SEPARATOR);
  7. write(out, width, value);
  8. out.write(EOL);
  9. }

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

  1. @Override
  2. public void write(OutputStream out) throws Exception {
  3. try {
  4. jar.write(out);
  5. }
  6. catch (Exception e) {
  7. e.printStackTrace();
  8. throw e;
  9. }
  10. }

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

  1. @Override
  2. public void write(OutputStream out) throws Exception {
  3. try {
  4. jar.write(out);
  5. }
  6. catch (Exception e) {
  7. e.printStackTrace();
  8. throw e;
  9. }
  10. }

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

  1. @Override
  2. public void write(OutputStream out) throws Exception {
  3. try {
  4. jar.write(out);
  5. }
  6. catch (Exception e) {
  7. e.printStackTrace();
  8. throw e;
  9. }
  10. }

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

  1. /**
  2. * Convert a string to bytes with UTF-8 and then output in max 72 bytes
  3. *
  4. * @param out the output string
  5. * @param width the current width
  6. * @param s the string to output
  7. * @return the new width
  8. * @throws IOException when something fails
  9. */
  10. private static int write(OutputStream out, int width, String s) throws IOException {
  11. byte[] bytes = s.getBytes(UTF_8);
  12. return write(out, width, bytes);
  13. }

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

  1. /**
  2. * Convert a string to bytes with UTF-8 and then output in max 72 bytes
  3. *
  4. * @param out the output string
  5. * @param width the current width
  6. * @param s the string to output
  7. * @return the new width
  8. * @throws IOException when something fails
  9. */
  10. private static int write(OutputStream out, int width, String s) throws IOException {
  11. byte[] bytes = s.getBytes(UTF_8);
  12. return write(out, width, bytes);
  13. }

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

  1. public void write(String file) throws Exception {
  2. check();
  3. write(new File(file));
  4. }

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

  1. public void write(String file) throws Exception {
  2. check();
  3. write(new File(file));
  4. }

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

  1. public void write(String file) throws Exception {
  2. check();
  3. write(new File(file));
  4. }

代码示例来源:origin: com.athaydes.osgiaas/osgiaas-jar-wrap

  1. private static File updateManifest( Jar newJar, File bundle, Manifest manifest )
  2. throws Exception {
  3. verifyDestinationFileCanBeWritten( bundle );
  4. newJar.setManifest( manifest );
  5. newJar.write( bundle );
  6. return bundle;
  7. }

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

  1. public void write(File file) throws Exception {
  2. check();
  3. try (OutputStream out = IO.outputStream(file)) {
  4. write(out);
  5. } catch (Exception t) {
  6. IO.delete(file);
  7. throw t;
  8. }
  9. file.setLastModified(lastModified);
  10. }

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

  1. public void write(File file) throws Exception {
  2. check();
  3. try (OutputStream out = IO.outputStream(file)) {
  4. write(out);
  5. } catch (Exception t) {
  6. IO.delete(file);
  7. throw t;
  8. }
  9. file.setLastModified(lastModified);
  10. }

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

  1. private void save(Release releaser, Revision revision, Jar jar) throws Exception {
  2. String classifier = jar.getName(); // jar name is classifier
  3. String extension = "jar";
  4. File tmp = File.createTempFile(classifier, extension);
  5. try {
  6. jar.write(tmp);
  7. releaser.add(revision.archive(extension, classifier), tmp);
  8. } finally {
  9. IO.delete(tmp);
  10. }
  11. }

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

  1. private void save(Release releaser, Revision revision, Jar jar) throws Exception {
  2. String classifier = jar.getName(); // jar name is classifier
  3. String extension = "jar";
  4. File tmp = File.createTempFile(classifier, extension);
  5. try {
  6. jar.write(tmp);
  7. releaser.add(revision.archive(extension, classifier), tmp);
  8. } finally {
  9. IO.delete(tmp);
  10. }
  11. }

代码示例来源:origin: reficio/p2-maven-plugin

  1. private void populateJar(Analyzer analyzer, File outputFile) throws Exception {
  2. Jar jar = analyzer.getJar();
  3. jar.setManifest(analyzer.calcManifest());
  4. try {
  5. jar.write(outputFile);
  6. } finally {
  7. jar.close();
  8. }
  9. }

相关文章