public class JarFileEntries extends Object implements CentralDirectoryVisitor, Iterable<JarEntry>
JarFile. In order to reduce memory
consumption entry details are stored using int arrays. The hashCodes array
stores the hash code of the entry name, the centralDirectoryOffsets provides
the offset to the central directory record and positions provides the original
order position of the entry. The arrays are stored in hashCode order so that a binary
search can be used to find a name.
A typical Spring Boot application will have somewhere in the region of 10,500 entries which should consume about 122K.
| 限定符和类型 | 字段和说明 |
|---|---|
protected static int |
ENTRY_CACHE_SIZE |
| 构造器和说明 |
|---|
JarFileEntries(JarFile jarFile,
JarEntryFilter filter) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clearCache() |
boolean |
containsEntry(String name) |
JarEntry |
getEntry(String name) |
RandomAccessData |
getEntryData(String name) |
InputStream |
getInputStream(com.alipay.sofa.ark.loader.jar.FileHeader entry,
RandomAccessData.ResourceAccess access) |
InputStream |
getInputStream(String name,
RandomAccessData.ResourceAccess access) |
Iterator<JarEntry> |
iterator() |
void |
visitEnd() |
void |
visitFileHeader(CentralDirectoryFileHeader fileHeader,
int dataOffset) |
void |
visitStart(CentralDirectoryEndRecord endRecord,
RandomAccessData centralDirectoryData) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprotected static final int ENTRY_CACHE_SIZE
public JarFileEntries(JarFile jarFile, JarEntryFilter filter)
public void visitStart(CentralDirectoryEndRecord endRecord, RandomAccessData centralDirectoryData)
visitStart 在接口中 CentralDirectoryVisitorpublic void visitFileHeader(CentralDirectoryFileHeader fileHeader, int dataOffset)
visitFileHeader 在接口中 CentralDirectoryVisitorpublic void visitEnd()
visitEnd 在接口中 CentralDirectoryVisitorpublic boolean containsEntry(String name)
public InputStream getInputStream(String name, RandomAccessData.ResourceAccess access) throws IOException
IOExceptionpublic InputStream getInputStream(com.alipay.sofa.ark.loader.jar.FileHeader entry, RandomAccessData.ResourceAccess access) throws IOException
IOExceptionpublic RandomAccessData getEntryData(String name) throws IOException
IOExceptionpublic void clearCache()
Copyright © 2019. All rights reserved.