public final class DexFile extends Object
.dex (Dalvik EXecutable)
file, which itself consists of a set of Dalvik classes.| Constructor and Description |
|---|
DexFile(DexOptions dexOptions)
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(ClassDefItem clazz)
Adds a class to this instance.
|
ClassDefItem |
getClassOrNull(String name)
Gets the class definition with the given name, if any.
|
DexOptions |
getDexOptions()
Gets the dex-creation options object.
|
Statistics |
getStatistics()
Generates and returns statistics for all the items in the file.
|
boolean |
isEmpty()
Returns true if this dex doesn't contain any class defs.
|
void |
setDumpWidth(int dumpWidth)
Sets the maximum width of the human-oriented dump of the instance.
|
byte[] |
toDex(Writer humanOut,
boolean verbose)
Returns the contents of this instance as a
.dex file,
in byte[] form. |
void |
writeTo(OutputStream out,
Writer humanOut,
boolean verbose)
Writes the contents of this instance as either a binary or a
human-readable form, or both.
|
public DexFile(DexOptions dexOptions)
public boolean isEmpty()
public DexOptions getDexOptions()
public void add(ClassDefItem clazz)
clazz - non-null; the class to addpublic ClassDefItem getClassOrNull(String name)
name - non-null; the class name to look fornull-ok; the class with the given name, or null
if there is no such classpublic void writeTo(OutputStream out, Writer humanOut, boolean verbose) throws IOException
out - null-ok; where to write tohumanOut - null-ok; where to write human-oriented output toverbose - whether to be verbose when writing human-oriented outputIOExceptionpublic byte[] toDex(Writer humanOut, boolean verbose) throws IOException
.dex file,
in byte[] form.humanOut - null-ok; where to write human-oriented output toverbose - whether to be verbose when writing human-oriented outputnon-null; a .dex file for this instanceIOExceptionpublic void setDumpWidth(int dumpWidth)
dumpWidth - >= 40; the widthpublic Statistics getStatistics()
non-null; the statisticsCopyright © 2014. All Rights Reserved.