.dex file. Each section consists of a list
of items of some sort or other.
| Modifier and Type | Field and Description |
|---|---|
| private final int | alignment
|
| private final DexFile | file
|
| private int | fileOffset
|
| private final String | name
|
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected final void | align(AnnotatedOutput
non-null; the output to alignAligns the output of the given data to the alignment of this instance. |
| public abstract int | Returns: >= 0; the item's absolute file offsetnon-null; the item in questionReturns the absolute file offset of the given item which must be contained in this section. |
| public final int | Returns: >= 0; the corresponding absolute file offset>= 0; the relative offsetReturns the absolute file offset, given an offset from the start of this instance's output. |
| public final int | |
| public final DexFile | |
| public final int | Returns: >= 0; the file offsetGets the offset from the start of the file to this part. |
| protected final String | Returns: null-ok; name of this part, for annotation purposesReturns the name of this section, for annotation purposes. |
| public abstract Collection | |
| public final void | |
| protected abstract void | |
| public final int | Returns: >= 0; the offset that this instance should be placed at
in order to meet its alignment constraint>= 0; the desired offset from the start of the
file where this for this instanceSets the file offset. |
| protected final void | |
| protected final void | |
| public static void | |
| public abstract int | Returns: >= 0; the size of this instance, in bytesGets the size of this instance when output, in bytes. |
| public final void | writeTo(AnnotatedOutput
non-null; where to write toWrites this instance to the given raw data object. |
| protected abstract void | writeTo0(AnnotatedOutput
non-null; where to write toWrites this instance to the given raw data object. |
| alignment | back to summary |
|---|---|
| private final int alignment
| |
| file | back to summary |
|---|---|
| private final DexFile file
| |
| fileOffset | back to summary |
|---|---|
| private int fileOffset
| |
| name | back to summary |
|---|---|
| private final String name
| |
| prepared | back to summary |
|---|---|
| private boolean prepared whether | |
| Section | back to summary |
|---|---|
| public Section(String name, DexFile file, int alignment) Constructs an instance. The file offset is initially unknown. | |
| align | back to summary |
|---|---|
| protected final void align(AnnotatedOutput out) Aligns the output of the given data to the alignment of this instance.
| |
| getAbsoluteItemOffset | back to summary |
|---|---|
| public abstract int getAbsoluteItemOffset(Item item) Returns the absolute file offset of the given item which must
be contained in this section. This is only valid to call
once this instance has been assigned a file offset (via Note Subclasses must implement this as appropriate for their contents.
| |
| getAbsoluteOffset | back to summary |
|---|---|
| public final int getAbsoluteOffset(int relative) Returns the absolute file offset, given an offset from the
start of this instance's output. This is only valid to call
once this instance has been assigned a file offset (via
| |
| getAlignment | back to summary |
|---|---|
| public final int getAlignment() Gets the alignment for this instance's final output.
| |
| getFile | back to summary |
|---|---|
| public final DexFile getFile() Gets the file that this instance is part of.
| |
| getFileOffset | back to summary |
|---|---|
| public final int getFileOffset() Gets the offset from the start of the file to this part. This throws an exception if the offset has not yet been set.
| |
| getName | back to summary |
|---|---|
| protected final String getName() Returns the name of this section, for annotation purposes.
| |
| items | back to summary |
|---|---|
| public abstract Collection Gets the collection of all the items in this section. It is not valid to attempt to change the returned list.
| |
| prepare | back to summary |
|---|---|
| public final void prepare() Prepares this instance for writing. This performs any necessary prerequisites, including particularly adding stuff to other sections. This method may only be called once per instance; subsequent calls will throw an exception. | |
| prepare0 | back to summary |
|---|---|
| protected abstract void prepare0() Does the main work of | |
| setFileOffset | back to summary |
|---|---|
| public final int setFileOffset(int fileOffset) Sets the file offset. It is only valid to call this method once once per instance.
| |
| throwIfNotPrepared | back to summary |
|---|---|
| protected final void throwIfNotPrepared() Throws an exception if | |
| throwIfPrepared | back to summary |
|---|---|
| protected final void throwIfPrepared() Throws an exception if | |
| validateAlignment | back to summary |
|---|---|
| public static void validateAlignment(int alignment) Validates an alignment.
| |
| writeSize | back to summary |
|---|---|
| public abstract int writeSize() Gets the size of this instance when output, in bytes.
| |
| writeTo | back to summary |
|---|---|
| public final void writeTo(AnnotatedOutput out) Writes this instance to the given raw data object.
| |
| writeTo0 | back to summary |
|---|---|
| protected abstract void writeTo0(AnnotatedOutput out) Writes this instance to the given raw data object. This gets
called by
| |