public static ListChannelCountRequest DeserializeLengthDelimited(Stream stream, ListChannelCountRequest instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(ListChannelCountRequest.Deserialize(stream, instance, num));
        }
        public static ListChannelCountRequest DeserializeLengthDelimited(Stream stream)
        {
            ListChannelCountRequest listChannelCountRequest = new ListChannelCountRequest();

            ListChannelCountRequest.DeserializeLengthDelimited(stream, listChannelCountRequest);
            return(listChannelCountRequest);
        }
        public static ListChannelCountRequest Deserialize(Stream stream, ListChannelCountRequest instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            while (limit < 0L || stream.get_Position() < limit)
            {
                int num = stream.ReadByte();
                if (num == -1)
                {
                    if (limit >= 0L)
                    {
                        throw new EndOfStreamException();
                    }
                    return(instance);
                }
                else
                {
                    int num2 = num;
                    if (num2 != 10)
                    {
                        if (num2 != 16)
                        {
                            if (num2 != 29)
                            {
                                Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                                uint field = key.Field;
                                if (field == 0u)
                                {
                                    throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                                }
                                ProtocolParser.SkipKey(stream, key);
                            }
                            else
                            {
                                instance.Program = binaryReader.ReadUInt32();
                            }
                        }
                        else
                        {
                            instance.ServiceType = ProtocolParser.ReadUInt32(stream);
                        }
                    }
                    else if (instance.MemberId == null)
                    {
                        instance.MemberId = EntityId.DeserializeLengthDelimited(stream);
                    }
                    else
                    {
                        EntityId.DeserializeLengthDelimited(stream, instance.MemberId);
                    }
                }
            }
            if (stream.get_Position() == limit)
            {
                return(instance);
            }
            throw new ProtocolBufferException("Read past max limit");
        }
        public static void Serialize(Stream stream, ListChannelCountRequest instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.MemberId == null)
            {
                throw new ArgumentNullException("MemberId", "Required by proto specification.");
            }
            stream.WriteByte(10);
            ProtocolParser.WriteUInt32(stream, instance.MemberId.GetSerializedSize());
            EntityId.Serialize(stream, instance.MemberId);
            stream.WriteByte(16);
            ProtocolParser.WriteUInt32(stream, instance.ServiceType);
            if (instance.HasProgram)
            {
                stream.WriteByte(29);
                binaryWriter.Write(instance.Program);
            }
        }
 public static ListChannelCountRequest Deserialize(Stream stream, ListChannelCountRequest instance)
 {
     return(ListChannelCountRequest.Deserialize(stream, instance, -1L));
 }
 public void Deserialize(Stream stream)
 {
     ListChannelCountRequest.Deserialize(stream, this);
 }
        public override bool Equals(object obj)
        {
            ListChannelCountRequest listChannelCountRequest = obj as ListChannelCountRequest;

            return(listChannelCountRequest != null && this.MemberId.Equals(listChannelCountRequest.MemberId) && this.ServiceType.Equals(listChannelCountRequest.ServiceType) && this.HasProgram == listChannelCountRequest.HasProgram && (!this.HasProgram || this.Program.Equals(listChannelCountRequest.Program)));
        }