public static ChannelCountDescription DeserializeLengthDelimited(Stream stream)
        {
            ChannelCountDescription channelCountDescription = new ChannelCountDescription();

            ChannelCountDescription.DeserializeLengthDelimited(stream, channelCountDescription);
            return(channelCountDescription);
        }
 public static IncrementChannelCountRequest Deserialize(Stream stream, IncrementChannelCountRequest instance, long limit)
 {
     if (instance.Descriptions == null)
     {
         instance.Descriptions = new List <ChannelCountDescription>();
     }
     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)
             {
                 if (num == 18)
                 {
                     instance.Descriptions.Add(ChannelCountDescription.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 (instance.AgentId != null)
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.AgentId);
             }
             else
             {
                 instance.AgentId = EntityId.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }