Exemplo n.º 1
0
        public static CurrencyRestriction DeserializeLengthDelimited(Stream stream)
        {
            CurrencyRestriction currencyRestriction = new CurrencyRestriction();

            CurrencyRestriction.DeserializeLengthDelimited(stream, currencyRestriction);
            return(currencyRestriction);
        }
 public static GetEBalanceRestrictionsResponse Deserialize(Stream stream, GetEBalanceRestrictionsResponse instance, long limit)
 {
     if (instance.CurrencyRestrictions == null)
     {
         instance.CurrencyRestrictions = new List <CurrencyRestriction>();
     }
     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.CurrencyRestrictions.Add(CurrencyRestriction.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);
 }