Search in sources :

Example 1 with DexIndexOverflowException

use of com.taobao.android.dex.DexIndexOverflowException in project atlas by alibaba.

the class TypeIdsSection method writeHeaderPart.

/**
 * 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" + new 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);
}
Also used : DexIndexOverflowException(com.taobao.android.dex.DexIndexOverflowException) Main(com.taobao.android.dx.command.dexer.Main)

Aggregations

DexIndexOverflowException (com.taobao.android.dex.DexIndexOverflowException)1 Main (com.taobao.android.dx.command.dexer.Main)1