package o; import com.google.protobuf.CodedOutputStream; import com.google.protobuf.UninitializedMessageException; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.Collection; import java.util.List; import o.AbstractC5573bvc; import o.AbstractC5573bvc.RVV; import o.InterfaceC16581pUl; import o.QwV; /* renamed from: o.bvc, reason: case insensitive filesystem */ /* loaded from: classes2.dex */ public abstract class AbstractC5573bvc, BuilderType extends RVV> implements InterfaceC16581pUl { protected int memoizedHashCode = 0; @Override // o.InterfaceC16581pUl public QwV toByteString() { try { QwV.jbe d = QwV.d(getSerializedSize()); writeTo(d.a); if (d.a.i() == 0) { return new QwV.ojQ(d.c); } throw new IllegalStateException("Did not write as much data as expected."); } catch (IOException e) { throw new RuntimeException(getSerializingExceptionMessage("ByteString"), e); } } @Override // o.InterfaceC16581pUl public byte[] toByteArray() { try { byte[] bArr = new byte[getSerializedSize()]; CodedOutputStream a = CodedOutputStream.a(bArr); writeTo(a); if (a.i() == 0) { return bArr; } throw new IllegalStateException("Did not write as much data as expected."); } catch (IOException e) { throw new RuntimeException(getSerializingExceptionMessage("byte array"), e); } } @Override // o.InterfaceC16581pUl public void writeTo(OutputStream outputStream) throws IOException { CodedOutputStream c = CodedOutputStream.c(outputStream, CodedOutputStream.f(getSerializedSize())); writeTo(c); c.f(); } int getMemoizedSerializedSize() { throw new UnsupportedOperationException(); } void setMemoizedSerializedSize(int i) { throw new UnsupportedOperationException(); } public int getSerializedSize(Wnq wnq) { int memoizedSerializedSize = getMemoizedSerializedSize(); if (memoizedSerializedSize != -1) { return memoizedSerializedSize; } int a = wnq.a(this); setMemoizedSerializedSize(a); return a; } /* JADX INFO: Access modifiers changed from: package-private */ public UninitializedMessageException newUninitializedMessageException() { return new UninitializedMessageException(); } private String getSerializingExceptionMessage(String str) { StringBuilder sb = new StringBuilder("Serializing "); sb.append(getClass().getName()); sb.append(" to a "); sb.append(str); sb.append(" threw an IOException (should never happen)."); return sb.toString(); } public static void addAll(Iterable iterable, List list) { RVV.addAll(iterable, list); } /* renamed from: o.bvc$RVV */ /* loaded from: classes2.dex */ public static abstract class RVV, BuilderType extends RVV> implements InterfaceC16581pUl.HBt { @Override // /* renamed from: clone */ public abstract BuilderType mo354clone(); protected abstract BuilderType internalMergeFrom(MessageType messagetype); /* JADX WARN: Multi-variable type inference failed */ @Override // o.InterfaceC16581pUl.HBt public BuilderType mergeFrom(InterfaceC16581pUl interfaceC16581pUl) { if (!getDefaultInstanceForType().getClass().isInstance(interfaceC16581pUl)) { throw new IllegalArgumentException("mergeFrom(MessageLite) can only merge messages of the same type."); } return (BuilderType) internalMergeFrom((AbstractC5573bvc) interfaceC16581pUl); } private static void addAllCheckingNulls(Iterable iterable, List list) { if ((list instanceof ArrayList) && (iterable instanceof Collection)) { ((ArrayList) list).ensureCapacity(list.size() + ((Collection) iterable).size()); } int size = list.size(); for (T t : iterable) { if (t == null) { StringBuilder sb = new StringBuilder("Element at index "); sb.append(list.size() - size); sb.append(" is null."); String obj = sb.toString(); for (int size2 = list.size() - 1; size2 >= size; size2--) { list.remove(size2); } throw new NullPointerException(obj); } list.add(t); } } /* JADX INFO: Access modifiers changed from: protected */ public static UninitializedMessageException newUninitializedMessageException(InterfaceC16581pUl interfaceC16581pUl) { return new UninitializedMessageException(); } protected static void addAll(Iterable iterable, List list) { MTP.d(iterable); if (iterable instanceof VWY) { List b = ((VWY) iterable).b(); VWY vwy = (VWY) list; int size = list.size(); for (Object obj : b) { if (obj == null) { StringBuilder sb = new StringBuilder("Element at index "); sb.append(vwy.size() - size); sb.append(" is null."); String obj2 = sb.toString(); for (int size2 = vwy.size() - 1; size2 >= size; size2--) { vwy.remove(size2); } throw new NullPointerException(obj2); } if (obj instanceof QwV) { vwy.c((QwV) obj); } else { vwy.add((String) obj); } } return; } if (iterable instanceof VAu) { list.addAll((Collection) iterable); } else { addAllCheckingNulls(iterable, list); } } } }