public static ListChannelCountResponse DeserializeLengthDelimited(Stream stream, ListChannelCountResponse instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(ListChannelCountResponse.Deserialize(stream, instance, position));
        }
        public static ListChannelCountResponse DeserializeLengthDelimited(Stream stream)
        {
            ListChannelCountResponse listChannelCountResponse = new ListChannelCountResponse();

            ListChannelCountResponse.DeserializeLengthDelimited(stream, listChannelCountResponse);
            return(listChannelCountResponse);
        }
Exemplo n.º 3
0
        public static ListChannelCountResponse DeserializeLengthDelimited(Stream stream, ListChannelCountResponse instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(ListChannelCountResponse.Deserialize(stream, instance, num));
        }
 public static void Serialize(Stream stream, ListChannelCountResponse instance)
 {
     if (instance.Channel.Count > 0)
     {
         foreach (bnet.protocol.channel_invitation.ChannelCount channel in instance.Channel)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, channel.GetSerializedSize());
             bnet.protocol.channel_invitation.ChannelCount.Serialize(stream, channel);
         }
     }
 }
Exemplo n.º 5
0
 public static void Serialize(Stream stream, ListChannelCountResponse instance)
 {
     if (instance.Channel.get_Count() > 0)
     {
         using (List <ChannelCount> .Enumerator enumerator = instance.Channel.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 ChannelCount current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 bnet.protocol.channel_invitation.ChannelCount.Serialize(stream, current);
             }
         }
     }
 }
 public static ListChannelCountResponse Deserialize(Stream stream, ListChannelCountResponse instance, long limit)
 {
     if (instance.Channel == null)
     {
         instance.Channel = new List <bnet.protocol.channel_invitation.ChannelCount>();
     }
     while (true)
     {
         if (limit < (long)0 || stream.Position < limit)
         {
             int num = stream.ReadByte();
             if (num == -1)
             {
                 if (limit >= (long)0)
                 {
                     throw new EndOfStreamException();
                 }
                 break;
             }
             else if (num == 10)
             {
                 instance.Channel.Add(bnet.protocol.channel_invitation.ChannelCount.DeserializeLengthDelimited(stream));
             }
             else
             {
                 Key key = ProtocolParser.ReadKey((byte)num, stream);
                 if (key.Field == 0)
                 {
                     throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                 }
                 ProtocolParser.SkipKey(stream, key);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
Exemplo n.º 7
0
 public static ListChannelCountResponse Deserialize(Stream stream, ListChannelCountResponse instance, long limit)
 {
     if (instance.Channel == null)
     {
         instance.Channel = new List <ChannelCount>();
     }
     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)
             {
                 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.Channel.Add(bnet.protocol.channel_invitation.ChannelCount.DeserializeLengthDelimited(stream));
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
        public override bool Equals(object obj)
        {
            ListChannelCountResponse listChannelCountResponse = obj as ListChannelCountResponse;

            if (listChannelCountResponse == null)
            {
                return(false);
            }
            if (this.Channel.Count != listChannelCountResponse.Channel.Count)
            {
                return(false);
            }
            for (int i = 0; i < this.Channel.Count; i++)
            {
                if (!this.Channel[i].Equals(listChannelCountResponse.Channel[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 9
0
        public override bool Equals(object obj)
        {
            ListChannelCountResponse listChannelCountResponse = obj as ListChannelCountResponse;

            if (listChannelCountResponse == null)
            {
                return(false);
            }
            if (this.Channel.get_Count() != listChannelCountResponse.Channel.get_Count())
            {
                return(false);
            }
            for (int i = 0; i < this.Channel.get_Count(); i++)
            {
                if (!this.Channel.get_Item(i).Equals(listChannelCountResponse.Channel.get_Item(i)))
                {
                    return(false);
                }
            }
            return(true);
        }
 public static ListChannelCountResponse Deserialize(Stream stream, ListChannelCountResponse instance)
 {
     return(ListChannelCountResponse.Deserialize(stream, instance, (long)-1));
 }
 public void Deserialize(Stream stream)
 {
     ListChannelCountResponse.Deserialize(stream, this);
 }