当前位置: 首页>>代码示例>>Java>>正文


Java DexIndexOverflowException类代码示例

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


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

示例1: writeHeaderPart

import com.android.dex.DexIndexOverflowException; //导入依赖的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 = typeIds.size();
    int offset = (sz == 0) ? 0 : getFileOffset();

    if (sz > DexFormat.MAX_TYPE_IDX + 1) {
        throw new DexIndexOverflowException("Too many type references: " + sz +
                "; max is " + (DexFormat.MAX_TYPE_IDX + 1) + ".\n" +
                Main.getTooManyIdsErrorMessage());
    }

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

    out.writeInt(sz);
    out.writeInt(offset);
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:26,代码来源:TypeIdsSection.java

示例2: main

import com.android.dex.DexIndexOverflowException; //导入依赖的package包/类
public static void main(String[] args) throws Throwable {

    for (int i = 0; i < NUMBER_OF_TRIES; i++) {
      String fileName1 = args[(int) (Math.random() * args.length)];
      String fileName2 = args[(int) (Math.random() * args.length)];
      try {
        Dex toMerge = new Dex(new File(fileName1));
        Dex toMerge2 = new Dex(new File(fileName2));
        new DexMerger(toMerge, toMerge2, CollisionPolicy.KEEP_FIRST).merge();
      } catch (DexIndexOverflowException e) {
        // ignore index overflow
      } catch (Throwable t) {
        System.err.println(
            "Problem merging those 2 dexes: \"" + fileName1 + "\" and \"" + fileName2 + "\"");
        throw t;
      }
    }
  }
 
开发者ID:facebook,项目名称:buck,代码行数:19,代码来源:MergeTest.java

示例3: orderItems

import com.android.dex.DexIndexOverflowException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void orderItems() {
    int idx = 0;

    if (items().size() > DexFormat.MAX_MEMBER_IDX + 1) {
        throw new DexIndexOverflowException(getTooManyMembersMessage());
    }

    for (Object i : items()) {
        ((MemberIdItem) i).setIndex(idx);
        idx++;
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:15,代码来源:MemberIdsSection.java

示例4: jumboCheck

import com.android.dex.DexIndexOverflowException; //导入依赖的package包/类
private static void jumboCheck(boolean isJumbo, int newIndex) {
    if (!isJumbo && (newIndex > 0xffff)) {
        throw new DexIndexOverflowException("Cannot merge new index " + newIndex +
                               " into a non-jumbo instruction!");
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:7,代码来源:InstructionTransformer.java


注:本文中的com.android.dex.DexIndexOverflowException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。