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

import java.io.IOException;

/* JADX INFO: renamed from: com.google.crypto.tink.shaded.protobuf.a, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC1253a implements Q {
    protected int memoizedHashCode;

    public abstract int a(c0 c0Var);

    public final String b(String str) {
        return "Serializing " + getClass().getName() + " to a " + str + " threw an IOException (should never happen).";
    }

    public abstract AbstractC1272u c();

    public final byte[] d() {
        try {
            int iA = ((AbstractC1274w) this).a(null);
            byte[] bArr = new byte[iA];
            C1264l c1264l = new C1264l(bArr, iA);
            e(c1264l);
            if (iA - c1264l.f13812k == 0) {
                return bArr;
            }
            throw new IllegalStateException("Did not write as much data as expected.");
        } catch (IOException e6) {
            throw new RuntimeException(b("byte array"), e6);
        }
    }

    public abstract void e(C1264l c1264l);
}
