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

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

java 3次浏览

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

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

示例1: ConstantPoolParser

点赞 2

import com.android.dx.rop.cst.StdConstantPool; //导入依赖的package包/类
/**
 * Constructs an instance.
 *
 * @param bytes {@code non-null;} the bytes of the file
 */
public ConstantPoolParser(ByteArray bytes) {
    int size = bytes.getUnsignedShort(8); // constant_pool_count

    this.bytes = bytes;
    this.pool = new StdConstantPool(size);
    this.offsets = new int[size];
    this.endOffset = -1;
}
 

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

示例2: DcfTypeList

点赞 2

import com.android.dx.rop.cst.StdConstantPool; //导入依赖的package包/类
/**
 * Constructs an instance.
 *
 * @param bytes {@code non-null;} original classfile's bytes
 * @param offset offset into {@link #bytes} for the start of the
 * data
 * @param size number of elements in the list (not number of bytes)
 * @param pool {@code non-null;} the constant pool to use
 * @param observer {@code null-ok;} parse observer to use, if any
 */
public DcfTypeList(ByteArray bytes, int offset, int size,
        StdConstantPool pool, ParseObserver observer) {
    if (size < 0) {
        throw new IllegalArgumentException("size < 0");
    }

    bytes = bytes.slice(offset, offset + size * 2);
    this.bytes = bytes;
    this.size = size;
    this.pool = pool;

    for (int i = 0; i < size; i++) {
        offset = i * 2;
        int idx = bytes.getUnsignedShort(offset);
        CstType type;
        try {
            type = (CstType) pool.get(idx);
        } catch (ClassCastException ex) {
            // Translate the exception.
            throw new RuntimeException("bogus class cpi", ex);
        }
        if (observer != null) {
            observer.parsed(bytes, offset, 2, "  " + type);
        }
    }
}
 

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

示例3: getPool

点赞 1

import com.android.dx.rop.cst.StdConstantPool; //导入依赖的package包/类
/**
 * Gets the actual constant pool.
 *
 * @return {@code non-null;} the constant pool
 */
public StdConstantPool getPool() {
    parseIfNecessary();
    return pool;
}
 

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


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