Пример #1
0
        public static AccountBlobList DeserializeLengthDelimited(Stream stream, AccountBlobList instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(AccountBlobList.Deserialize(stream, instance, num));
        }
Пример #2
0
        public static AccountBlobList DeserializeLengthDelimited(Stream stream, AccountBlobList instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(AccountBlobList.Deserialize(stream, instance, position));
        }
Пример #3
0
        public static AccountBlobList DeserializeLengthDelimited(Stream stream)
        {
            AccountBlobList accountBlobList = new AccountBlobList();

            AccountBlobList.DeserializeLengthDelimited(stream, accountBlobList);
            return(accountBlobList);
        }
Пример #4
0
 public static void Serialize(Stream stream, AccountBlobList instance)
 {
     if (instance.Blob.Count > 0)
     {
         foreach (AccountBlob accountBlob in instance.Blob)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, accountBlob.GetSerializedSize());
             AccountBlob.Serialize(stream, accountBlob);
         }
     }
 }
Пример #5
0
 public static void Serialize(Stream stream, AccountBlobList instance)
 {
     if (instance.Blob.get_Count() > 0)
     {
         using (List <AccountBlob> .Enumerator enumerator = instance.Blob.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 AccountBlob current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 AccountBlob.Serialize(stream, current);
             }
         }
     }
 }
Пример #6
0
 public static AccountBlobList Deserialize(Stream stream, AccountBlobList instance, long limit)
 {
     if (instance.Blob == null)
     {
         instance.Blob = new List <AccountBlob>();
     }
     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.Blob.Add(AccountBlob.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);
 }
Пример #7
0
 public static AccountBlobList Deserialize(Stream stream, AccountBlobList instance, long limit)
 {
     if (instance.Blob == null)
     {
         instance.Blob = new List <AccountBlob>();
     }
     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.Blob.Add(AccountBlob.DeserializeLengthDelimited(stream));
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Пример #8
0
        public override bool Equals(object obj)
        {
            AccountBlobList accountBlobList = obj as AccountBlobList;

            if (accountBlobList == null)
            {
                return(false);
            }
            if (this.Blob.get_Count() != accountBlobList.Blob.get_Count())
            {
                return(false);
            }
            for (int i = 0; i < this.Blob.get_Count(); i++)
            {
                if (!this.Blob.get_Item(i).Equals(accountBlobList.Blob.get_Item(i)))
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #9
0
        public override bool Equals(object obj)
        {
            AccountBlobList accountBlobList = obj as AccountBlobList;

            if (accountBlobList == null)
            {
                return(false);
            }
            if (this.Blob.Count != accountBlobList.Blob.Count)
            {
                return(false);
            }
            for (int i = 0; i < this.Blob.Count; i++)
            {
                if (!this.Blob[i].Equals(accountBlobList.Blob[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #10
0
 public static AccountBlobList Deserialize(Stream stream, AccountBlobList instance)
 {
     return(AccountBlobList.Deserialize(stream, instance, -1L));
 }
Пример #11
0
 public void Deserialize(Stream stream)
 {
     AccountBlobList.Deserialize(stream, this);
 }