|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.dex.file.DexFile
public final class DexFile
Representation of an entire .dex (Dalvik EXecutable)
file, which itself consists of a set of Dalvik classes.
| Constructor Summary | |
|---|---|
DexFile(DexOptions dexOptions)
Constructs an instance. |
|
| Method Summary | |
|---|---|
void |
add(ClassDefItem clazz)
Adds a class to this instance. |
ClassDefsSection |
getClassDefs()
Gets the class definitions section. |
ClassDefItem |
getClassOrNull(String name)
Gets the class definition with the given name, if any. |
DexOptions |
getDexOptions()
Gets the dex-creation options object. |
FieldIdsSection |
getFieldIds()
Gets the field identifiers section. |
int |
getFileSize()
Gets the total file size, if known. |
MethodIdsSection |
getMethodIds()
Gets the method identifiers section. |
Statistics |
getStatistics()
Generates and returns statistics for all the items in the file. |
TypeIdsSection |
getTypeIds()
Gets the type identifiers section. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DexFile(DexOptions dexOptions)
| Method Detail |
|---|
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 for
null-ok; the class with the given name, or null
if there is no such class
public 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 output
IOException
public 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 output
non-null; a .dex file for this instance
IOExceptionpublic void setDumpWidth(int dumpWidth)
dumpWidth - >= 40; the widthpublic int getFileSize()
This is package-scope in order to allow
the HeaderSection to set itself up properly.
>= 0; the total file size
RuntimeException - thrown if the file size is not yet knownpublic ClassDefsSection getClassDefs()
This is package-scope in order to allow
the various Item instances to add items to the
instance.
non-null; the class definitions sectionpublic TypeIdsSection getTypeIds()
This is public in order to allow
the various Item instances to add items to the
instance and help early counting of type ids.
non-null; the class identifiers sectionpublic FieldIdsSection getFieldIds()
This is public in order to allow
the various Item instances to add items to the
instance and help early counting of field ids.
non-null; the field identifiers sectionpublic MethodIdsSection getMethodIds()
This is public in order to allow
the various Item instances to add items to the
instance and help early counting of method ids.
non-null; the method identifiers sectionpublic Statistics getStatistics()
non-null; the statistics
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||