package defpackage;

import com.hierynomus.protocol.commons.buffer.Buffer$BufferException;
import java.nio.charset.Charset;

/* renamed from: ᵢʽᵟ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3253 {

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final /* synthetic */ int f12252;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public static final byte[] f12250 = {0, 0};

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public static final C3253 f12249 = new C3253(1);

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public static final C3253 f12251 = new C3253(0);

    public /* synthetic */ C3253(int i) {
        this.f12252 = i;
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public static String m7612(AbstractC4362 abstractC4362, int i, Charset charset) throws Buffer$BufferException {
        int i2 = i * 2;
        byte[] bArr = new byte[i2];
        abstractC4362.m9346(i2, bArr);
        return new String(bArr, charset);
    }

    public final String toString() {
        switch (this.f12252) {
            case 0:
                return "big endian";
            default:
                return "little endian";
        }
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final void m7613(AbstractC4362 abstractC4362, int i) {
        switch (this.f12252) {
            case 0:
                if (i >= 0 && i <= 65535) {
                    abstractC4362.mo5106(2, new byte[]{(byte) (i >> 8), (byte) i});
                    break;
                } else {
                    ᵹˉᵞ.ˌᵜᵹᵩ(AbstractC2990.m7313(i, "Invalid uint16 value: "));
                    break;
                }
            default:
                if (i >= 0 && i <= 65535) {
                    abstractC4362.mo5106(2, new byte[]{(byte) i, (byte) (i >> 8)});
                    break;
                } else {
                    ᵹˉᵞ.ˌᵜᵹᵩ(AbstractC2990.m7313(i, "Invalid uint16 value: "));
                    break;
                }
        }
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final void m7614(AbstractC4362 abstractC4362, long j) {
        switch (this.f12252) {
            case 0:
                abstractC4362.mo5106(8, new byte[]{(byte) (j >> 56), (byte) (j >> 48), (byte) (j >> 40), (byte) (j >> 32), (byte) (j >> 24), (byte) (j >> 16), (byte) (j >> 8), (byte) j});
                break;
            default:
                abstractC4362.mo5106(8, new byte[]{(byte) j, (byte) (j >> 8), (byte) (j >> 16), (byte) (j >> 24), (byte) (j >> 32), (byte) (j >> 40), (byte) (j >> 48), (byte) (j >> 56)});
                break;
        }
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final long m7615(AbstractC4362 abstractC4362) throws Buffer$BufferException {
        switch (this.f12252) {
            case 0:
                abstractC4362.getClass();
                abstractC4362.m9346(4, new byte[4]);
                return (r13[3] & 255) | (4278190080L & (r13[0] << 24)) | (16711680 & (r13[1] << 16)) | ((r13[2] << 8) & 65280);
            default:
                abstractC4362.getClass();
                abstractC4362.m9346(4, new byte[4]);
                return ((r13[3] << 24) & 4278190080L) | (16711680 & (r13[2] << 16)) | (65280 & (r13[1] << 8)) | (255 & r13[0]);
        }
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final void m7616(AbstractC4362 abstractC4362, String str) {
        switch (this.f12252) {
            case 0:
                byte[] bytes = str.getBytes(AbstractC5005.f18586);
                abstractC4362.getClass();
                abstractC4362.mo5106(bytes.length, bytes);
                break;
            default:
                byte[] bytes2 = str.getBytes(AbstractC5005.f18584);
                abstractC4362.getClass();
                abstractC4362.mo5106(bytes2.length, bytes2);
                break;
        }
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final long m7617(AbstractC4362 abstractC4362) throws Buffer$BufferException {
        long j = 0;
        switch (this.f12252) {
            case 0:
                abstractC4362.getClass();
                abstractC4362.m9346(8, new byte[8]);
                for (int i = 0; i < 8; i++) {
                    j = (j << 8) | (r5[i] & 255);
                }
                break;
            default:
                abstractC4362.getClass();
                abstractC4362.m9346(8, new byte[8]);
                for (int i2 = 7; i2 >= 0; i2--) {
                    j = (j << 8) | (r5[i2] & 255);
                }
                break;
        }
        return j;
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final int m7618(AbstractC4362 abstractC4362) {
        int i;
        int i2;
        switch (this.f12252) {
            case 0:
                abstractC4362.getClass();
                byte[] bArr = new byte[2];
                abstractC4362.m9346(2, bArr);
                i = (bArr[0] << 8) & 65280;
                i2 = bArr[1] & 255;
                break;
            default:
                abstractC4362.getClass();
                byte[] bArr2 = new byte[2];
                abstractC4362.m9346(2, bArr2);
                i = bArr2[0] & 255;
                i2 = (bArr2[1] << 8) & 65280;
                break;
        }
        return i2 | i;
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final void m7619(AbstractC4362 abstractC4362, long j) {
        switch (this.f12252) {
            case 0:
                if (j < 0) {
                    ᵹˉᵞ.ˌᵜᵹᵩ(AbstractC4737.m10015(j, "Invalid uint64 value: "));
                    break;
                } else {
                    m7614(abstractC4362, j);
                    break;
                }
            default:
                if (j < 0) {
                    ᵹˉᵞ.ˌᵜᵹᵩ(AbstractC4737.m10015(j, "Invalid uint64 value: "));
                    break;
                } else {
                    m7614(abstractC4362, j);
                    break;
                }
        }
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final long m7620(AbstractC4362 abstractC4362) throws Buffer$BufferException {
        switch (this.f12252) {
            case 0:
                long jM7615 = (m7615(abstractC4362) << 32) + (m7615(abstractC4362) & 4294967295L);
                if (jM7615 >= 0) {
                    return jM7615;
                }
                throw new Buffer$BufferException("Cannot handle values > 9223372036854775807");
            default:
                long jM76152 = (4294967295L & m7615(abstractC4362)) + (m7615(abstractC4362) << 32);
                if (jM76152 >= 0) {
                    return jM76152;
                }
                throw new Buffer$BufferException("Cannot handle values > 9223372036854775807");
        }
    }
}
