package com.google.crypto.tink.shaded.protobuf;

import defpackage.AbstractC2251;
import defpackage.AbstractC4613;
import defpackage.C1236;
import defpackage.C1379;
import defpackage.InterfaceC2321;
import defpackage.InterfaceC2623;
import java.io.IOException;

/* JADX INFO: renamed from: com.google.crypto.tink.shaded.protobuf.ᵲᵶᵳˈ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC0024 implements InterfaceC2321 {
    protected int memoizedHashCode;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final String m895(String str) {
        return "Serializing " + getClass().getName() + " to a " + str + " threw an IOException (should never happen).";
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final byte[] m896() {
        try {
            int iMo889 = ((AbstractC0021) this).mo889(null);
            byte[] bArr = new byte[iMo889];
            C1379 c1379 = new C1379(iMo889, bArr);
            mo890(c1379);
            if (iMo889 - c1379.f5718 == 0) {
                return bArr;
            }
            throw new IllegalStateException("Did not write as much data as expected.");
        } catch (IOException e) {
            ᵷᵝˎ.ᵪᵹᵥᵻ(m895("byte array"), e);
            return null;
        }
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public abstract int mo889(InterfaceC2623 interfaceC2623);

    /* JADX INFO: renamed from: ᵵᵽ */
    public abstract void mo890(C1379 c1379);

    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public abstract AbstractC2251 mo891();

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final C1236 m897() {
        try {
            int iMo889 = ((AbstractC0021) this).mo889(null);
            C1236 c1236 = AbstractC4613.f17546;
            byte[] bArr = new byte[iMo889];
            C1379 c1379 = new C1379(iMo889, bArr);
            mo890(c1379);
            if (c1379.f5716 - c1379.f5718 == 0) {
                return new C1236(bArr);
            }
            throw new IllegalStateException("Did not write as much data as expected.");
        } catch (IOException e) {
            ᵷᵝˎ.ᵪᵹᵥᵻ(m895("ByteString"), e);
            return null;
        }
    }
}
