package com.tencent.mm.plugin.appbrand.jsapi.file;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.r.d;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;

public class e$a {
    static final Map<String, e> hJH;

    static void init() {
    }

    static {
        AppMethodBeat.i(102775);
        HashMap hashMap = new HashMap();
        hJH = hashMap;
        hashMap.put("ascii", new 1());
        hJH.put("base64", new 2());
        hJH.put("hex", new e() {
            public final String o(ByteBuffer byteBuffer) {
                AppMethodBeat.i(102764);
                String bigInteger = new BigInteger(1, d.q(byteBuffer)).toString(16);
                AppMethodBeat.o(102764);
                return bigInteger;
            }

            public final ByteBuffer AY(String str) {
                AppMethodBeat.i(102765);
                ByteBuffer wrap = ByteBuffer.wrap(new BigInteger(str, 16).toByteArray());
                AppMethodBeat.o(102765);
                return wrap;
            }
        });
        4 4 = new 4(Charset.forName("ISO-10646-UCS-2"));
        hJH.put("ucs2", 4);
        hJH.put("ucs-2", 4);
        final Charset forName = Charset.forName("UTF-16LE");
        AnonymousClass5 anonymousClass5 = new e() {
            public final String o(ByteBuffer byteBuffer) {
                AppMethodBeat.i(102768);
                byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
                String str = new String(d.q(byteBuffer), forName);
                AppMethodBeat.o(102768);
                return str;
            }

            public final ByteBuffer AY(String str) {
                AppMethodBeat.i(102769);
                ByteBuffer order = ByteBuffer.wrap(str.getBytes(forName)).order(ByteOrder.LITTLE_ENDIAN);
                AppMethodBeat.o(102769);
                return order;
            }
        };
        hJH.put("utf16le", anonymousClass5);
        hJH.put("utf-16le", anonymousClass5);
        6 6 = new 6();
        hJH.put("utf8", 6);
        hJH.put("utf-8", 6);
        7 7 = new 7();
        hJH.put("latin1", 7);
        hJH.put("binary", 7);
        AppMethodBeat.o(102775);
    }
}
