public class CachedZipArchive
extends com.android.zipflinger.ZipArchive
There is not point keeping an entry in the cache once it has been requested by the V1 sign engine. Therefore, a cache entry is removed upon a cache hit.
Since the V1 signing engine ask to inspect an entry right away (as soon as "add" is called), and since each cache entry is deleted when the content has been retrieved, this class has little impact on the memory usage.
| Constructor and Description |
|---|
CachedZipArchive(java.io.File file) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(com.android.zipflinger.BytesSource source) |
void |
delete(java.lang.String name) |
java.nio.ByteBuffer |
getContent(java.lang.String name) |
public CachedZipArchive(@NonNull
java.io.File file)
throws java.io.IOException
java.io.IOException@Nullable
public java.nio.ByteBuffer getContent(@NonNull
java.lang.String name)
throws java.io.IOException
getContent in class com.android.zipflinger.ZipArchivejava.io.IOExceptionpublic void add(@NonNull
com.android.zipflinger.BytesSource source)
throws java.io.IOException
add in interface com.android.zipflinger.Archiveadd in class com.android.zipflinger.ZipArchivejava.io.IOExceptionpublic void delete(@NonNull
java.lang.String name)
delete in interface com.android.zipflinger.Archivedelete in class com.android.zipflinger.ZipArchive