當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。