本文整理了Java中org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource
类的一些代码示例,展示了ZipInputStreamZipEntrySource
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipInputStreamZipEntrySource
类的具体详情如下:
包路径:org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource
类名称:ZipInputStreamZipEntrySource
[英]Provides a way to get at all the ZipEntries from a ZipInputStream, as many times as required. Allows a ZipInputStream to be treated much like a ZipFile, for a price in terms of memory. Be sure to call #close() as soon as you're done, to free up that memory!
[中]提供了一种从ZipInputStream获取所有ZipPentries的方法,可以根据需要多次获取。允许ZipInputStream像ZipFile一样被处理,以内存为代价。确保完成后立即调用#close(),以释放内存!
代码示例来源:origin: org.apache.poi/poi-ooxml
private static ZipEntrySource openZipEntrySourceStream(ZipArchiveThresholdInputStream zis) throws InvalidOperationException {
// Acquire the final level resource. If this is acquired successfully, the zip package was read successfully from the input stream
try {
// open the zip entry source stream
return new ZipInputStreamZipEntrySource(zis);
} catch (IOException e) {
throw new InvalidOperationException("Could not open the specified zip entry source stream", e);
}
}
代码示例来源:origin: org.apache.poi/poi-ooxml
/**
* Constructor. Opens a Zip based Open XML document from
* an InputStream.
*
* @param in
* Zip input stream to load.
* @param access
* The package access mode.
* @throws IllegalArgumentException
* If the specified input stream not an instance of
* ZipInputStream.
* @throws IOException
* if input stream cannot be opened, read, or closed
*/
ZipPackage(InputStream in, PackageAccess access) throws IOException {
super(access);
ZipArchiveThresholdInputStream zis = ZipHelper.openZipStream(in); // NOSONAR
try {
this.zipArchive = new ZipInputStreamZipEntrySource(zis);
} catch (final IOException e) {
IOUtils.closeQuietly(zis);
throw e;
}
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
/**
* Constructor. <b>Operation not supported.</b>
*
* @param in
* Zip input stream to load.
* @param access
* @throws IllegalArgumentException
* If the specified input stream not an instance of
* ZipInputStream.
*/
ZipPackage(InputStream in, PackageAccess access) throws IOException {
super(access);
this.zipArchive = new ZipInputStreamZipEntrySource(
new ZipInputStream(in)
);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
private static ZipEntrySource openZipEntrySourceStream(ZipArchiveThresholdInputStream zis) throws InvalidOperationException {
// Acquire the final level resource. If this is acquired successfully, the zip package was read successfully from the input stream
try {
// open the zip entry source stream
return new ZipInputStreamZipEntrySource(zis);
} catch (IOException e) {
throw new InvalidOperationException("Could not open the specified zip entry source stream", e);
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* Constructor. Opens a Zip based Open XML document from
* an InputStream.
*
* @param in
* Zip input stream to load.
* @param access
* The package access mode.
* @throws IllegalArgumentException
* If the specified input stream not an instance of
* ZipInputStream.
* @throws IOException
* if input stream cannot be opened, read, or closed
*/
ZipPackage(InputStream in, PackageAccess access) throws IOException {
super(access);
ZipArchiveThresholdInputStream zis = ZipHelper.openZipStream(in); // NOSONAR
try {
this.zipArchive = new ZipInputStreamZipEntrySource(zis);
} catch (final IOException e) {
IOUtils.closeQuietly(zis);
throw e;
}
}
内容来源于网络,如有侵权,请联系作者删除!