本文整理汇总了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);
}
示例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;
}
}
}
示例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++;
}
}
示例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!");
}
}