org.jboss.shrinkwrap.api.Archive.writeTo()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(90)

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

Archive.writeTo介绍

[英]Prints the content of this Archive to the specified OutputStream on the format defined by the specified Formatter. The caller is responsible for opening, flushing and eventually closing the stream.
[中]以指定格式化程序定义的格式将此存档的内容打印到指定的OutputStream。调用方负责打开、刷新并最终关闭流。

代码示例

代码示例来源:origin: wildfly/wildfly-arquillian

@Override
public void writeTo(final OutputStream outputStream, final Formatter formatter) throws IllegalArgumentException {
  delegate.writeTo(outputStream, formatter);
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base

/**
 * {@inheritDoc}
 */
@Override
public void writeTo(final OutputStream outputStream, final Formatter formatter) throws IllegalArgumentException {
  this.getArchive().writeTo(outputStream, formatter);
}

代码示例来源:origin: shrinkwrap/shrinkwrap

/**
 * {@inheritDoc}
 */
@Override
public void writeTo(final OutputStream outputStream, final Formatter formatter) throws IllegalArgumentException {
  this.getArchive().writeTo(outputStream, formatter);
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
public void archiveWriteToShouldWriteToStream() throws Exception {
  MockOutputStream outputStream = new MockOutputStream();
  final File testFile = TestIOUtil.createFileFromResourceName(TEST_ARCHIVE);
  final Archive<?> archive = ShrinkWrap.createFromZipFile(JavaArchive.class, testFile);
  byte[] archiveToString = archive.toString(Formatters.SIMPLE).getBytes();
  archive.writeTo(outputStream, Formatters.SIMPLE);
  Assert.assertArrayEquals("Inconsistent writes?", archiveToString, outputStream.getContents());
  outputStream = new MockOutputStream();
  archiveToString = archive.toString(Formatters.VERBOSE).getBytes();
  archive.writeTo(outputStream, Formatters.VERBOSE);
  Assert.assertArrayEquals("Inconsistent writes?", archiveToString, outputStream.getContents());
}

相关文章