public class ZipInputStreamZipEntrySource extends java.lang.Object implements ZipEntrySource
close()
as soon as you're done, to free up that memory!
(提供一种从 ZipInputStream 获取所有 ZipEntries 的方法,根据需要多次获取。允许将 ZipInputStream 与 ZipFile 类似地对待,但要以内存为代价。确保在完成后立即调用 close() 以释放内存!)
Constructor and Description |
---|
ZipInputStreamZipEntrySource(ZipArchiveThresholdInputStream inp)
Reads all the entries from the ZipInputStream into memory, and don't close (since POI 4.0.1) the source stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Indicates we are done with reading, and resources may be freed
(表示我们已完成阅读,可以释放资源)
|
java.util.Enumeration<? extends org.apache.commons.compress.archivers.zip.ZipArchiveEntry> |
getEntries()
Returns an Enumeration of all the Entries
(返回所有条目的枚举)
|
org.apache.commons.compress.archivers.zip.ZipArchiveEntry |
getEntry(java.lang.String path)
Return an entry by its path
(按路径返回条目)
|
java.io.InputStream |
getInputStream(org.apache.commons.compress.archivers.zip.ZipArchiveEntry zipEntry)
Returns an InputStream of the decompressed data that makes up the entry
(返回组成条目的解压缩数据的 InputStream)
|
boolean |
isClosed()
Has close been called already?
(close 已经被调用了吗?)
|
public ZipInputStreamZipEntrySource(ZipArchiveThresholdInputStream inp) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public java.util.Enumeration<? extends org.apache.commons.compress.archivers.zip.ZipArchiveEntry> getEntries()
ZipEntrySource
getEntries
in interface
ZipEntrySource
(ZipEntrySource 接口中的 getEntries)
public java.io.InputStream getInputStream(org.apache.commons.compress.archivers.zip.ZipArchiveEntry zipEntry)
ZipEntrySource
getInputStream
in interface
ZipEntrySource
(ZipEntrySource 接口中的 getInputStream)
public void close() throws java.io.IOException
ZipEntrySource
close
in interface
java.io.Closeable
(在接口 java.io.Closeable 中关闭)
close
in interface
java.lang.AutoCloseable
(在接口 java.lang.AutoCloseable 中关闭)
close
in interface
ZipEntrySource
(在接口 ZipEntrySource 中关闭)
java.io.IOException
(java.io.IOException)
public boolean isClosed()
ZipEntrySource
isClosed
in interface
ZipEntrySource
(isClosed 在接口 ZipEntrySource 中)
public org.apache.commons.compress.archivers.zip.ZipArchiveEntry getEntry(java.lang.String path)
ZipEntrySource
getEntry
in interface
ZipEntrySource
(ZipEntrySource 接口中的 getEntry)
path
- the path in unix-notation
(path - unix-notation 中的路径)
null
if not found
(如果没有找到该条目或 null)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.