public class NonIncrementalJarDexArchive extends java.lang.Object implements DexArchive
DexArchive that does not support incremental updates.| Constructor and Description |
|---|
NonIncrementalJarDexArchive(java.nio.file.Path targetPath) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFile(java.nio.file.Path relativePath,
byte[] bytes,
int offset,
int end)
Adds a DEX file to this dex archive from a byte[].
|
void |
addFile(java.nio.file.Path relativePath,
java.io.InputStream inputStream)
Adds a DEX file to this dex archive.
|
void |
close() |
java.util.List<DexArchiveEntry> |
getFiles()
Returns collection of all entries,
DexArchiveEntry, in this dex archive. |
java.nio.file.Path |
getRootPath()
Returns the path to this DEX archive.
|
void |
removeFile(java.nio.file.Path relativePath)
Removes the specified DEX file from the dex archive.
|
public NonIncrementalJarDexArchive(java.nio.file.Path targetPath)
throws java.io.IOException
java.io.IOException@NonNull public java.nio.file.Path getRootPath()
DexArchivegetRootPath in interface DexArchivepublic void addFile(@NonNull
java.nio.file.Path relativePath,
@NonNull
java.io.InputStream inputStream)
throws java.io.IOException
DexArchiveDexArchive.getRootPath(). In case file with the same relative path already exists, implementations of
this method should overwrite it with the new version of the file.addFile in interface DexArchiverelativePath - file to be added to this archiveinputStream - data to writejava.io.IOExceptionpublic void addFile(@NonNull
java.nio.file.Path relativePath,
byte[] bytes,
int offset,
int end)
throws java.io.IOException
DexArchiveDexArchive.getRootPath(). In case file with the same relative path already exists, implementations of
this method should overwrite it with the new version of the file.addFile in interface DexArchiverelativePath - file to be added to this archivebytes - the buffer to get the dex file content fromoffset - the offset for the buffer window.end - the end of the buffer window.java.io.IOException - if the dex file cannot be written.public void removeFile(@NonNull
java.nio.file.Path relativePath)
throws java.io.IOException
DexArchiveremoveFile in interface DexArchiverelativePath - file to be removed from the dex archive, relative to the DexArchive.getRootPath()java.io.IOException@NonNull public java.util.List<DexArchiveEntry> getFiles() throws java.io.IOException
DexArchiveDexArchiveEntry, in this dex archive. The entries
contain information about the relative path, DexArchiveEntry.getRelativePathInArchive() as well as the actual DEX file content, DexArchiveEntry.getDexFileContent().getFiles in interface DexArchivejava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException