package defpackage;

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

/* JADX INFO: renamed from: ʽˇᵨ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C0094 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public static final byte[] f1322 = {0, 0};

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public static final C0094 f1323 = new C0094(1);

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public static final C0094 f1324 = new C0094(0);

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final /* synthetic */ int f1325;

    public /* synthetic */ C0094(int i) {
        this.f1325 = i;
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public static String m1154(AbstractC0692 abstractC0692, int i, Charset charset) throws Buffer$BufferException {
        int i2 = i * 2;
        byte[] bArr = new byte[i2];
        abstractC0692.m2475(i2, bArr);
        return new String(bArr, charset);
    }

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

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final int m1155(AbstractC0692 abstractC0692) {
        int i;
        int i2;
        switch (this.f1325) {
            case 0:
                abstractC0692.getClass();
                byte[] bArr = new byte[2];
                abstractC0692.m2475(2, bArr);
                i = (bArr[0] << 8) & 65280;
                i2 = bArr[1] & 255;
                break;
            default:
                abstractC0692.getClass();
                byte[] bArr2 = new byte[2];
                abstractC0692.m2475(2, bArr2);
                i = bArr2[0] & 255;
                i2 = (bArr2[1] << 8) & 65280;
                break;
        }
        return i2 | i;
    }

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final void m1156(AbstractC0692 abstractC0692, long j) {
        switch (this.f1325) {
            case 0:
                if (j < 0) {
                    ᵕᵩʽᵲ.ᵮᵣᵗˈ(AbstractC0659.m2417(j, "Invalid uint64 value: "));
                } else {
                    m1162(abstractC0692, j);
                }
                break;
            default:
                if (j < 0) {
                    ᵕᵩʽᵲ.ᵮᵣᵗˈ(AbstractC0659.m2417(j, "Invalid uint64 value: "));
                } else {
                    m1162(abstractC0692, j);
                }
                break;
        }
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final long m1157(AbstractC0692 abstractC0692) throws Buffer$BufferException {
        switch (this.f1325) {
            case 0:
                abstractC0692.getClass();
                byte[] bArr = new byte[4];
                abstractC0692.m2475(4, bArr);
                return (((long) bArr[3]) & 255) | (4278190080L & ((long) (bArr[0] << 24))) | (16711680 & ((long) (bArr[1] << 16))) | (((long) (bArr[2] << 8)) & 65280);
            default:
                abstractC0692.getClass();
                byte[] bArr2 = new byte[4];
                abstractC0692.m2475(4, bArr2);
                return (((long) (bArr2[3] << 24)) & 4278190080L) | (16711680 & ((long) (bArr2[2] << 16))) | (65280 & ((long) (bArr2[1] << 8))) | (255 & ((long) bArr2[0]));
        }
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final long m1158(AbstractC0692 abstractC0692) throws Buffer$BufferException {
        long j = 0;
        switch (this.f1325) {
            case 0:
                abstractC0692.getClass();
                byte[] bArr = new byte[8];
                abstractC0692.m2475(8, bArr);
                for (int i = 0; i < 8; i++) {
                    j = (j << 8) | ((long) (bArr[i] & 255));
                }
                break;
            default:
                abstractC0692.getClass();
                byte[] bArr2 = new byte[8];
                abstractC0692.m2475(8, bArr2);
                for (int i2 = 7; i2 >= 0; i2--) {
                    j = (j << 8) | ((long) (bArr2[i2] & 255));
                }
                break;
        }
        return j;
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final void m1159(AbstractC0692 abstractC0692, int i) {
        switch (this.f1325) {
            case 0:
                if (i >= 0 && i <= 65535) {
                    abstractC0692.mo2472(2, new byte[]{(byte) (i >> 8), (byte) i});
                } else {
                    ᵕᵩʽᵲ.ᵮᵣᵗˈ(AbstractC2704.m6517(i, "Invalid uint16 value: "));
                }
                break;
            default:
                if (i >= 0 && i <= 65535) {
                    abstractC0692.mo2472(2, new byte[]{(byte) i, (byte) (i >> 8)});
                } else {
                    ᵕᵩʽᵲ.ᵮᵣᵗˈ(AbstractC2704.m6517(i, "Invalid uint16 value: "));
                }
                break;
        }
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final long m1160(AbstractC0692 abstractC0692) throws Buffer$BufferException {
        switch (this.f1325) {
            case 0:
                long jM1157 = (m1157(abstractC0692) << 32) + (m1157(abstractC0692) & 4294967295L);
                if (jM1157 >= 0) {
                    return jM1157;
                }
                throw new Buffer$BufferException("Cannot handle values > 9223372036854775807");
            default:
                long jM11572 = (4294967295L & m1157(abstractC0692)) + (m1157(abstractC0692) << 32);
                if (jM11572 >= 0) {
                    return jM11572;
                }
                throw new Buffer$BufferException("Cannot handle values > 9223372036854775807");
        }
    }

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public final void m1161(AbstractC0692 abstractC0692, String str) {
        switch (this.f1325) {
            case 0:
                byte[] bytes = str.getBytes(AbstractC4722.f17964);
                abstractC0692.getClass();
                abstractC0692.mo2472(bytes.length, bytes);
                break;
            default:
                byte[] bytes2 = str.getBytes(AbstractC4722.f17965);
                abstractC0692.getClass();
                abstractC0692.mo2472(bytes2.length, bytes2);
                break;
        }
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final void m1162(AbstractC0692 abstractC0692, long j) {
        switch (this.f1325) {
            case 0:
                abstractC0692.mo2472(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:
                abstractC0692.mo2472(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;
        }
    }
}
