public abstract class BaseDumper extends java.lang.Object implements ParseObserver
| Modifier and Type | Field and Description |
|---|---|
protected com.android.dx.command.dump.Args |
args
commandline parsedArgs
|
protected DexOptions |
dexOptions
non-null; options for dex output, always set to the defaults for now |
| Constructor and Description |
|---|
BaseDumper(byte[] bytes,
java.io.PrintStream out,
java.lang.String filePath,
com.android.dx.command.dump.Args args)
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changeIndent(int indentDelta)
Indicate that the level of indentation for a dump should increase
or decrease (positive or negative argument, respectively).
|
void |
endParsingMember(ByteArray bytes,
int offset,
java.lang.String name,
java.lang.String descriptor,
Member member)
Indicate that a particular member is no longer being parsed.
|
protected byte[] |
getBytes()
Gets the array of
bytes to process. |
protected java.lang.String |
getFilePath()
Gets the filesystem/jar path of the file being dumped.
|
protected boolean |
getRawBytes()
Gets whether this dump is to include raw bytes.
|
protected int |
getReadBytes()
Gets the current number of read bytes.
|
protected boolean |
getStrictParse()
Gets whether to be strict about parsing.
|
protected int |
getWidth1()
Gets the width of the first column of output.
|
protected int |
getWidth2()
Gets the width of the second column of output.
|
protected java.lang.String |
hexDump(int offset,
int len)
Constructs a hex data dump of the given portion of
bytes. |
void |
parsed(ByteArray bytes,
int offset,
int len,
java.lang.String human)
Indicate that some parsing happened.
|
protected void |
print(java.lang.String s)
Prints the given string to this instance's output stream.
|
protected void |
println(java.lang.String s)
Prints the given string to this instance's output stream, followed
by a newline.
|
void |
startParsingMember(ByteArray bytes,
int offset,
java.lang.String name,
java.lang.String descriptor)
Indicate that a particular member is now being parsed.
|
protected java.lang.String |
twoColumns(java.lang.String s1,
java.lang.String s2)
Combines a pair of strings as two columns, or if this is one-column
output, format the otherwise-second column.
|
protected com.android.dx.command.dump.Args args
protected final DexOptions dexOptions
non-null; options for dex output, always set to the defaults for nowpublic BaseDumper(byte[] bytes,
java.io.PrintStream out,
java.lang.String filePath,
com.android.dx.command.dump.Args args)
bytes - non-null; bytes of the (alleged) class file
on the left)out - non-null; where to dump tofilePath - the file path for the class, excluding any base
directory specificationpublic void changeIndent(int indentDelta)
changeIndent in interface ParseObserverindentDelta - the amount to change indentationpublic void parsed(ByteArray bytes, int offset, int len, java.lang.String human)
parsed in interface ParseObserverbytes - non-null; the source that was parsedoffset - offset into bytes for what was parsedlen - number of bytes parsedhuman - non-null; human form for what was parsedpublic void startParsingMember(ByteArray bytes, int offset, java.lang.String name, java.lang.String descriptor)
startParsingMember in interface ParseObserverbytes - non-null; the source that is being parsedoffset - offset into bytes for the start of the
membername - non-null; name of the memberdescriptor - non-null; descriptor of the memberpublic void endParsingMember(ByteArray bytes, int offset, java.lang.String name, java.lang.String descriptor, Member member)
endParsingMember in interface ParseObserverbytes - non-null; the source that was parsedoffset - offset into bytes for the end of the
membername - non-null; name of the memberdescriptor - non-null; descriptor of the membermember - non-null; the actual member that was parsedprotected final int getReadBytes()
>= 0; the dump cursorprotected final byte[] getBytes()
bytes to process.non-null; the bytesprotected final java.lang.String getFilePath()
non-null; the pathprotected final boolean getStrictParse()
protected final void print(java.lang.String s)
s - null-ok; string to printprotected final void println(java.lang.String s)
s - null-ok; string to printprotected final boolean getRawBytes()
protected final int getWidth1()
0
unless raw bytes are being included in the output.>= 0; the width of the first columnprotected final int getWidth2()
>= 0; the width of the second columnprotected final java.lang.String hexDump(int offset,
int len)
bytes.offset - offset to start dumping atlen - length to dumpnon-null; the dumpprotected final java.lang.String twoColumns(java.lang.String s1,
java.lang.String s2)
s1 - non-null; the first column's strings2 - non-null; the second column's stringnon-null; the combined outputCopyright © 2020. All Rights Reserved.