package nano;

import com.google.protobuf.nano.CodedInputByteBufferNano;
import com.google.protobuf.nano.CodedOutputByteBufferNano;
import com.google.protobuf.nano.InternalNano;
import com.google.protobuf.nano.InvalidProtocolBufferNanoException;
import com.google.protobuf.nano.MessageNano;
import com.google.protobuf.nano.WireFormatNano;
import java.io.IOException;
import nano.ConnectTurnoverRequest;

/* compiled from: TbsSdkJava */
public interface TrendTurnoverRequest {

    /* compiled from: TbsSdkJava */
    public static final class TrendTurnover_Request extends MessageNano {

        private static volatile TrendTurnover_Request[] _emptyArray;

        public ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection[] requestData;

        public TrendTurnover_Request() {
            clear();
        }

        public static TrendTurnover_Request[] emptyArray() {
            if (_emptyArray == null) {
                synchronized (InternalNano.LAZY_INIT_LOCK) {
                    try {
                        if (_emptyArray == null) {
                            _emptyArray = new TrendTurnover_Request[0];
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                }
            }
            return _emptyArray;
        }

        public static TrendTurnover_Request parseFrom(byte[] bArr) throws InvalidProtocolBufferNanoException {
            return (TrendTurnover_Request) MessageNano.mergeFrom(new TrendTurnover_Request(), bArr);
        }

        public TrendTurnover_Request clear() {
            this.requestData = ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection.emptyArray();
            this.cachedSize = -1;
            return this;
        }

        /* access modifiers changed from: protected */
        public int computeSerializedSize() {
            int computeSerializedSize = super.computeSerializedSize();
            ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection[] exchangeTradeDirectionArr = this.requestData;
            if (exchangeTradeDirectionArr != null && exchangeTradeDirectionArr.length > 0) {
                int i10 = 0;
                while (true) {
                    ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection[] exchangeTradeDirectionArr2 = this.requestData;
                    if (i10 >= exchangeTradeDirectionArr2.length) {
                        break;
                    }
                    ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection exchangeTradeDirection = exchangeTradeDirectionArr2[i10];
                    if (exchangeTradeDirection != null) {
                        computeSerializedSize += CodedOutputByteBufferNano.computeMessageSize(1, exchangeTradeDirection);
                    }
                    i10++;
                }
            }
            return computeSerializedSize;
        }

        public void writeTo(CodedOutputByteBufferNano codedOutputByteBufferNano) throws IOException {
            ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection[] exchangeTradeDirectionArr = this.requestData;
            if (exchangeTradeDirectionArr != null && exchangeTradeDirectionArr.length > 0) {
                int i10 = 0;
                while (true) {
                    ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection[] exchangeTradeDirectionArr2 = this.requestData;
                    if (i10 >= exchangeTradeDirectionArr2.length) {
                        break;
                    }
                    ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection exchangeTradeDirection = exchangeTradeDirectionArr2[i10];
                    if (exchangeTradeDirection != null) {
                        codedOutputByteBufferNano.writeMessage(1, exchangeTradeDirection);
                    }
                    i10++;
                }
            }
            super.writeTo(codedOutputByteBufferNano);
        }

        public static TrendTurnover_Request parseFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
            return new TrendTurnover_Request().mergeFrom(codedInputByteBufferNano);
        }

        public TrendTurnover_Request mergeFrom(CodedInputByteBufferNano codedInputByteBufferNano) throws IOException {
            while (true) {
                int readTag = codedInputByteBufferNano.readTag();
                if (readTag == 0) {
                    return this;
                }
                if (readTag == 10) {
                    int repeatedFieldArrayLength = WireFormatNano.getRepeatedFieldArrayLength(codedInputByteBufferNano, 10);
                    ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection[] exchangeTradeDirectionArr = this.requestData;
                    int length = exchangeTradeDirectionArr == null ? 0 : exchangeTradeDirectionArr.length;
                    int i10 = repeatedFieldArrayLength + length;
                    ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection[] exchangeTradeDirectionArr2 = new ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection[i10];
                    if (length != 0) {
                        System.arraycopy(exchangeTradeDirectionArr, 0, exchangeTradeDirectionArr2, 0, length);
                    }
                    while (length < i10 - 1) {
                        ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection exchangeTradeDirection = new ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection();
                        exchangeTradeDirectionArr2[length] = exchangeTradeDirection;
                        codedInputByteBufferNano.readMessage(exchangeTradeDirection);
                        codedInputByteBufferNano.readTag();
                        length++;
                    }
                    ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection exchangeTradeDirection2 = new ConnectTurnoverRequest.ConnectTurnover_Request.ExchangeTradeDirection();
                    exchangeTradeDirectionArr2[length] = exchangeTradeDirection2;
                    codedInputByteBufferNano.readMessage(exchangeTradeDirection2);
                    this.requestData = exchangeTradeDirectionArr2;
                } else if (!WireFormatNano.parseUnknownField(codedInputByteBufferNano, readTag)) {
                    return this;
                }
            }
        }
    }
}
