• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AnnotatedOutput类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中com.android.dx.util.AnnotatedOutput的典型用法代码示例。如果您正苦于以下问题:Java AnnotatedOutput类的具体用法?Java AnnotatedOutput怎么用?Java AnnotatedOutput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

AnnotatedOutput类属于com.android.dx.util包,在下文中一共展示了AnnotatedOutput类的36个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: writeTo

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/**
 * Writes this instance to the given raw data object.
 *
 * @param out {@code non-null;} where to write to
 */
public final void writeTo(AnnotatedOutput out) {
    throwIfNotPrepared();
    align(out);

    int cursor = out.getCursor();

    if (fileOffset < 0) {
        fileOffset = cursor;
    } else if (fileOffset != cursor) {
        throw new RuntimeException("alignment mismatch: for " + this +
                                   ", at " + cursor +
                                   ", but expected " + fileOffset);
    }

    if (out.annotates()) {
        if (name != null) {
            out.annotate(0, "\n" + name + ":");
        } else if (cursor != 0) {
            out.annotate(0, "\n");
        }
    }

    writeTo0(out);
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:30,
代码来源:Section.java

示例2: writeTo

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    int cpi = ((CstInsn) insn).getIndex();
    RegisterSpecList regs = explicitize(insn.getRegisters());
    int sz = regs.size();
    int r0 = (sz > 0) ? regs.get(0).getReg() : 0;
    int r1 = (sz > 1) ? regs.get(1).getReg() : 0;
    int r2 = (sz > 2) ? regs.get(2).getReg() : 0;
    int r3 = (sz > 3) ? regs.get(3).getReg() : 0;
    int r4 = (sz > 4) ? regs.get(4).getReg() : 0;

    write(out,
          opcodeUnit(insn,
                     makeByte(r4, sz)), // encode the fifth operand here
          (short) cpi,
          codeUnit(r0, r1, r2, r3));
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:19,
代码来源:Form35c.java

示例3: writeTo0

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void writeTo0(DexFile file, AnnotatedOutput out) {
    int size = items.size();

    if (out.annotates()) {
        out.annotate(0, offsetString() + " " + typeName());
        out.annotate(4, "  size: " + Hex.u4(size));
    }

    out.writeInt(size);

    for (OffsettedItem i : items) {
        i.writeTo(file, out);
    }
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:17,
代码来源:UniformListItem.java

示例4: writeTo0

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void writeTo0(DexFile file, AnnotatedOutput out) {
    boolean annotates = out.annotates();

    if (annotates) {
        out.annotate(0, offsetString() + " encoded array");

        /*
         * The output is to be annotated, so redo the work previously
         * done by place0(), except this time annotations will actually
         * get emitted.
         */
        ValueEncoder encoder = new ValueEncoder(file, out);
        encoder.writeArray(array, true);
    } else {
        out.write(encodedForm);
    }
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:20,
代码来源:EncodedArrayItem.java

示例5: writeTo0

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void writeTo0(DexFile file, AnnotatedOutput out) {
    boolean annotates = out.annotates();
    int size = items.length;

    if (annotates) {
        out.annotate(0, offsetString() + " annotation set");
        out.annotate(4, "  size: " + Hex.u4(size));
    }

    out.writeInt(size);

    for (int i = 0; i < size; i++) {
        AnnotationItem item = items[i];
        int offset = item.getAbsoluteOffset();

        if (annotates) {
            out.annotate(4, "  entries[" + Integer.toHexString(i) + "]: " +
                    Hex.u4(offset));
            items[i].annotateTo(out, "    ");
        }

        out.writeInt(offset);
    }
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:27,
代码来源:AnnotationSetItem.java

示例6: writeTo

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public final void writeTo(DexFile file, AnnotatedOutput out) {
    TypeIdsSection typeIds = file.getTypeIds();
    StringIdsSection stringIds = file.getStringIds();
    CstNat nat = cst.getNat();
    int classIdx = typeIds.indexOf(getDefiningClass());
    int nameIdx = stringIds.indexOf(nat.getName());
    int typoidIdx = getTypoidIdx(file);

    if (out.annotates()) {
        out.annotate(0, indexString() + ' ' + cst.toHuman());
        out.annotate(2, "  class_idx: " + Hex.u2(classIdx));
        out.annotate(2, String.format("  %-10s %s", getTypoidName() + ':',
                        Hex.u2(typoidIdx)));
        out.annotate(4, "  name_idx:  " + Hex.u4(nameIdx));
    }

    out.writeShort(classIdx);
    out.writeShort(typoidIdx);
    out.writeInt(nameIdx);
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:23,
代码来源:MemberIdItem.java

示例7: writeHeaderPart

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/**
 * Writes the portion of the file header that refers to this instance.
 *
 * @param out {@code non-null;} where to write
 */
public void writeHeaderPart(AnnotatedOutput out) {
    throwIfNotPrepared();

    int sz = protoIds.size();
    int offset = (sz == 0) ? 0 : getFileOffset();

    if (sz > 65536) {
        throw new UnsupportedOperationException("too many proto ids");
    }

    if (out.annotates()) {
        out.annotate(4, "proto_ids_size:  " + Hex.u4(sz));
        out.annotate(4, "proto_ids_off:   " + Hex.u4(offset));
    }

    out.writeInt(sz);
    out.writeInt(offset);
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:24,
代码来源:ProtoIdsSection.java

示例8: writeTo0

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void writeTo0(DexFile file, AnnotatedOutput out) {
    TypeIdsSection typeIds = file.getTypeIds();
    int sz = list.size();

    if (out.annotates()) {
        out.annotate(0, offsetString() + " type_list");
        out.annotate(HEADER_SIZE, "  size: " + Hex.u4(sz));
        for (int i = 0; i < sz; i++) {
            Type one = list.getType(i);
            int idx = typeIds.indexOf(one);
            out.annotate(ELEMENT_SIZE,
                         "  " + Hex.u2(idx) + " // " + one.toHuman());
        }
    }

    out.writeInt(sz);

    for (int i = 0; i < sz; i++) {
        out.writeShort(typeIds.indexOf(list.getType(i)));
    }
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:24,
代码来源:TypeListItem.java

示例9: encodeList

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/**
 * Helper for {@link #encodeOutput}, which writes out the given
 * list. It also annotates the items (if any and if annotations
 * are enabled).
 *
 * @param file {@code non-null;} file this instance is part of
 * @param out {@code non-null;} where to write to
 * @param label {@code non-null;} the label for the purposes of annotation
 * @param list {@code non-null;} the list in question
 */
private static void encodeList(DexFile file, AnnotatedOutput out,
        String label, ArrayList<? extends EncodedMember> list) {
    int size = list.size();
    int lastIndex = 0;

    if (size == 0) {
        return;
    }

    if (out.annotates()) {
        out.annotate(0, "  " + label + ":");
    }

    for (int i = 0; i < size; i++) {
        lastIndex = list.get(i).encode(file, out, lastIndex, i);
    }
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:28,
代码来源:ClassDataItem.java

示例10: writeTo0

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo0(DexFile file, AnnotatedOutput out) {
    boolean annotates = out.annotates();

    if (annotates) {
        /*
         * The output is to be annotated, so redo the work previously
         * done by place0(), except this time annotations will actually
         * get emitted.
         */
        encodeOutput(file, out);
    } else {
        out.write(encodedForm);
    }
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:17,
代码来源:ClassDataItem.java

示例11: writeTo0

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo0(DexFile file, AnnotatedOutput out) {
    ByteArray bytes = value.getBytes();
    int utf16Size = value.getUtf16Size();

    if (out.annotates()) {
        out.annotate(Leb128.unsignedLeb128Size(utf16Size),
                "utf16_size: " + Hex.u4(utf16Size));
        out.annotate(bytes.size() + 1, value.toQuoted());
    }

    out.writeUleb128(utf16Size);
    out.write(bytes);
    out.writeByte(0);
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:17,
代码来源:StringDataItem.java

示例12: encode

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/**
 * Performs debug info encoding.
 *
 * @param file {@code null-ok;} file to refer to during encoding
 * @param prefix {@code null-ok;} prefix to attach to each line of output
 * @param debugPrint {@code null-ok;} if specified, an alternate output for
 * annotations
 * @param out {@code null-ok;} if specified, where annotations should go
 * @param consume whether to claim to have consumed output for
 * {@code out}
 * @return {@code non-null;} the encoded array
 */
private byte[] encode(DexFile file, String prefix, PrintWriter debugPrint,
        AnnotatedOutput out, boolean consume) {
    byte[] result = encode0(file, prefix, debugPrint, out, consume);

    if (ENABLE_ENCODER_SELF_CHECK && (file != null)) {
        try {
            DebugInfoDecoder.validateEncode(result, file, ref, code,
                    isStatic);
        } catch (RuntimeException ex) {
            // Reconvert, annotating to System.err.
            encode0(file, "", new PrintWriter(System.err, true), null,
                    false);
            throw ex;
        }
    }

    return result;
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:31,
代码来源:DebugInfoItem.java

示例13: writeTo

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    CstLiteralBits cb = (CstLiteralBits) ((CstInsn) insn).getConstant();
    short bits;

    // Where the high bits are depends on the category of the target.
    if (regs.get(0).getCategory() == 1) {
        bits = (short) (cb.getIntBits() >>> 16);
    } else {
        bits = (short) (cb.getLongBits() >>> 48);
    }

    write(out, opcodeUnit(insn, regs.get(0).getReg()), bits);
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:17,
代码来源:Form21h.java

示例14: writeTo

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int sz = regs.size();

    /*
     * The (sz - 2) and (sz - 1) below makes this code work for
     * both the two- and three-register ops. (See "case 3" in
     * isCompatible(), above.)
     */

    write(out, opcodeUnit(insn,
                          makeByte(regs.get(sz - 2).getReg(),
                                   regs.get(sz - 1).getReg())));
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:17,
代码来源:Form12x.java

示例15: encodeOutput

点赞 3

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/**
 * Writes out the encoded form of this instance.
 *
 * @param file {@code non-null;} file this instance is part of
 * @param out {@code non-null;} where to write to
 */
private void encodeOutput(DexFile file, AnnotatedOutput out) {
    boolean annotates = out.annotates();

    if (annotates) {
        out.annotate(0, offsetString() + " class data for " +
                thisClass.toHuman());
    }

    encodeSize(file, out, "static_fields", staticFields.size());
    encodeSize(file, out, "instance_fields", instanceFields.size());
    encodeSize(file, out, "direct_methods", directMethods.size());
    encodeSize(file, out, "virtual_methods", virtualMethods.size());

    encodeList(file, out, "static_fields", staticFields);
    encodeList(file, out, "instance_fields", instanceFields);
    encodeList(file, out, "direct_methods", directMethods);
    encodeList(file, out, "virtual_methods", virtualMethods);

    if (annotates) {
        out.endAnnotation();
    }
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:29,
代码来源:ClassDataItem.java

示例16: writeTo0

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void writeTo0(DexFile file, AnnotatedOutput out) {
    int value = type.getMapValue();
    int offset;

    if (firstItem == null) {
        offset = section.getFileOffset();
    } else {
        offset = section.getAbsoluteItemOffset(firstItem);
    }

    if (out.annotates()) {
        out.annotate(0, offsetString() + ' ' + type.getTypeName() +
                " map");
        out.annotate(2, "  type:   " + Hex.u2(value) + " // " +
                type.toString());
        out.annotate(2, "  unused: 0");
        out.annotate(4, "  size:   " + Hex.u4(itemCount));
        out.annotate(4, "  offset: " + Hex.u4(offset));
    }

    out.writeShort(value);
    out.writeShort(0); // unused
    out.writeInt(itemCount);
    out.writeInt(offset);
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:28,
代码来源:MapItem.java

示例17: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int value =
        ((CstLiteralBits) ((CstInsn) insn).getConstant()).getIntBits();

    write(out,
          opcodeUnit(insn, regs.get(0).getReg()),
          codeUnit(regs.get(1).getReg(), value & 0xff));
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:12,
代码来源:Form22b.java

示例18: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out, opcodeUnit(insn, 0), (short) offset);
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:8,
代码来源:Form20t.java

示例19: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int value =
        ((CstLiteralBits) ((CstInsn) insn).getConstant()).getIntBits();

    write(out, opcodeUnit(insn, regs.get(0).getReg()), value);
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:10,
代码来源:Form31i.java

示例20: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int cpi = ((CstInsn) insn).getIndex();

    write(out, opcodeUnit(insn, regs.get(0).getReg()), cpi);
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:9,
代码来源:Form31c.java

示例21: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
public void writeTo(DexFile file, AnnotatedOutput out) {
    int methodIdx = file.getMethodIds().indexOf(method);
    int annotationsOff = annotationsItem.getAbsoluteOffset();

    if (out.annotates()) {
        out.annotate(0, "    " + method.toHuman());
        out.annotate(4, "      method_idx:      " + Hex.u4(methodIdx));
        out.annotate(4, "      annotations_off: " +
                Hex.u4(annotationsOff));
    }

    out.writeInt(methodIdx);
    out.writeInt(annotationsOff);
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:16,
代码来源:ParameterAnnotationStruct.java

示例22: writeHeaderPart

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/**
 * Writes the portion of the file header that refers to this instance.
 *
 * @param out {@code non-null;} where to write
 */
public void writeHeaderPart(AnnotatedOutput out) {
    throwIfNotPrepared();

    int sz = fieldIds.size();
    int offset = (sz == 0) ? 0 : getFileOffset();

    if (out.annotates()) {
        out.annotate(4, "field_ids_size:  " + Hex.u4(sz));
        out.annotate(4, "field_ids_off:   " + Hex.u4(offset));
    }

    out.writeInt(sz);
    out.writeInt(offset);
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:20,
代码来源:FieldIdsSection.java

示例23: encodeSize

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/**
 * Helper for {@link #encodeOutput}, which writes out the given
 * size value, annotating it as well (if annotations are enabled).
 *
 * @param file {@code non-null;} file this instance is part of
 * @param out {@code non-null;} where to write to
 * @param label {@code non-null;} the label for the purposes of annotation
 * @param size {@code >= 0;} the size to write
 */
private static void encodeSize(DexFile file, AnnotatedOutput out,
        String label, int size) {
    if (out.annotates()) {
        out.annotate(String.format("  %-21s %08x", label + "_size:",
                        size));
    }

    out.writeUleb128(size);
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:19,
代码来源:ClassDataItem.java

示例24: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int cpi = ((CstInsn) insn).getIndex();

    write(out,
          opcodeUnit(insn, regs.get(0).getReg()),
          (short) cpi);
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:11,
代码来源:Form21c.java

示例25: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    long value =
        ((CstLiteral64) ((CstInsn) insn).getConstant()).getLongBits();

    write(out, opcodeUnit(insn, regs.get(0).getReg()), value);
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:10,
代码来源:Form51l.java

示例26: ValueEncoder

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/**
 * Construct an instance.
 *
 * @param file {@code non-null;} file being written
 * @param out {@code non-null;} output stream to write to
 */
public ValueEncoder(DexFile file, AnnotatedOutput out) {
    if (file == null) {
        throw new NullPointerException("file == null");
    }

    if (out == null) {
        throw new NullPointerException("out == null");
    }

    this.file = file;
    this.out = out;
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:19,
代码来源:ValueEncoder.java

示例27: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out, opcodeUnit(insn, 0), offset);
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:8,
代码来源:Form30t.java

示例28: writeCodes

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/**
 * Helper for {@link #writeTo0} which writes out the actual bytecode.
 *
 * @param file {@code non-null;} file we are part of
 * @param out {@code non-null;} where to write to
 */
private void writeCodes(DexFile file, AnnotatedOutput out) {
    DalvInsnList insns = code.getInsns();

    try {
        insns.writeTo(out);
    } catch (RuntimeException ex) {
        throw ExceptionWithContext.withContext(ex, "...while writing " +
                "instructions for " + ref.toHuman());
    }
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:17,
代码来源:CodeItem.java

示例29: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out,
          opcodeUnit(insn, regs.get(0).getReg()),
          (short) offset);
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:11,
代码来源:Form21t.java

示例30: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int value =
        ((CstLiteralBits) ((CstInsn) insn).getConstant()).getIntBits();

    write(out,
          opcodeUnit(insn, regs.get(0).getReg()),
          (short) value);
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:12,
代码来源:Form21s.java

示例31: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
public void writeTo(DexFile file, AnnotatedOutput out) {
    int fieldIdx = file.getFieldIds().indexOf(field);
    int annotationsOff = annotations.getAbsoluteOffset();

    if (out.annotates()) {
        out.annotate(0, "    " + field.toHuman());
        out.annotate(4, "      field_idx:       " + Hex.u4(fieldIdx));
        out.annotate(4, "      annotations_off: " +
                Hex.u4(annotationsOff));
    }

    out.writeInt(fieldIdx);
    out.writeInt(annotationsOff);
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:16,
代码来源:FieldAnnotationStruct.java

示例32: writeTo0

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void writeTo0(DexFile file, AnnotatedOutput out) {
    int annotationsOff = annotations.getAbsoluteOffset();

    if (out.annotates()) {
        out.annotate(4, "  annotations_off: " + Hex.u4(annotationsOff));
    }

    out.writeInt(annotationsOff);
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:12,
代码来源:AnnotationSetRefItem.java

示例33: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
public void writeTo(DexFile file, AnnotatedOutput out) {
    int methodIdx = file.getMethodIds().indexOf(method);
    int annotationsOff = annotations.getAbsoluteOffset();

    if (out.annotates()) {
        out.annotate(0, "    " + method.toHuman());
        out.annotate(4, "      method_idx:      " + Hex.u4(methodIdx));
        out.annotate(4, "      annotations_off: " +
                Hex.u4(annotationsOff));
    }

    out.writeInt(methodIdx);
    out.writeInt(annotationsOff);
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:16,
代码来源:MethodAnnotationStruct.java

示例34: writeTo0

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void writeTo0(DexFile file, AnnotatedOutput out) {
    boolean annotates = out.annotates();
    AnnotationVisibility visibility = annotation.getVisibility();

    if (annotates) {
        out.annotate(0, offsetString() + " annotation");
        out.annotate(1, "  visibility: VISBILITY_" + visibility);
    }

    switch (visibility) {
        case BUILD:   out.writeByte(VISIBILITY_BUILD); break;
        case RUNTIME: out.writeByte(VISIBILITY_RUNTIME); break;
        case SYSTEM:  out.writeByte(VISIBILITY_SYSTEM); break;
        default: {
            // EMBEDDED shouldn't appear at the top level.
            throw new RuntimeException("shouldn't happen");
        }
    }

    if (annotates) {
        /*
         * The output is to be annotated, so redo the work previously
         * done by place0(), except this time annotations will actually
         * get emitted.
         */
        ValueEncoder encoder = new ValueEncoder(file, out);
        encoder.writeAnnotation(annotation, true);
    } else {
        out.write(encodedForm);
    }
}
 

开发者ID:johnlee175,
项目名称:dex,
代码行数:34,
代码来源:AnnotationItem.java

示例35: writeHeaderPart

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/**
 * Writes the portion of the file header that refers to this instance.
 *
 * @param out {@code non-null;} where to write
 */
public void writeHeaderPart(AnnotatedOutput out) {
    throwIfNotPrepared();

    int sz = classDefs.size();
    int offset = (sz == 0) ? 0 : getFileOffset();

    if (out.annotates()) {
        out.annotate(4, "class_defs_size: " + Hex.u4(sz));
        out.annotate(4, "class_defs_off:  " + Hex.u4(offset));
    }

    out.writeInt(sz);
    out.writeInt(offset);
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:20,
代码来源:ClassDefsSection.java

示例36: writeTo

点赞 2

import com.android.dx.util.AnnotatedOutput; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(DexFile file, AnnotatedOutput out) {
    int dataOff = data.getAbsoluteOffset();

    if (out.annotates()) {
        out.annotate(0, indexString() + ' ' + value.toQuoted(100));
        out.annotate(4, "  string_data_off: " + Hex.u4(dataOff));
    }

    out.writeInt(dataOff);
}
 

开发者ID:AndreJCL,
项目名称:JCL,
代码行数:13,
代码来源:StringIdItem.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)