本文整理匯總了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!");
}
}