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

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

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

            SubscribeChannelResponse.DeserializeLengthDelimited(stream, subscribeChannelResponse);
            return(subscribeChannelResponse);
        }
 public static SubscribeChannelResponse Deserialize(Stream stream, SubscribeChannelResponse instance, long limit)
 {
     while (limit < 0L || stream.Position < limit)
     {
         int num = stream.ReadByte();
         if (num == -1)
         {
             if (limit >= 0L)
             {
                 throw new EndOfStreamException();
             }
             return(instance);
         }
         else if (num != 8)
         {
             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.ObjectId = ProtocolParser.ReadUInt64(stream);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Пример #5
0
 public static void Serialize(Stream stream, SubscribeChannelResponse instance)
 {
     if (instance.HasObjectId)
     {
         stream.WriteByte(8);
         ProtocolParser.WriteUInt64(stream, instance.ObjectId);
     }
 }
Пример #6
0
        public override bool Equals(object obj)
        {
            SubscribeChannelResponse subscribeChannelResponse = obj as SubscribeChannelResponse;

            if (subscribeChannelResponse == null)
            {
                return(false);
            }
            if (this.HasObjectId == subscribeChannelResponse.HasObjectId && (!this.HasObjectId || this.ObjectId.Equals(subscribeChannelResponse.ObjectId)))
            {
                return(true);
            }
            return(false);
        }
Пример #7
0
 public void Serialize(Stream stream)
 {
     SubscribeChannelResponse.Serialize(stream, this);
 }
Пример #8
0
 public static SubscribeChannelResponse Deserialize(Stream stream, SubscribeChannelResponse instance)
 {
     return(SubscribeChannelResponse.Deserialize(stream, instance, -1L));
 }
Пример #9
0
        public override bool Equals(object obj)
        {
            SubscribeChannelResponse subscribeChannelResponse = obj as SubscribeChannelResponse;

            return(subscribeChannelResponse != null && this.HasObjectId == subscribeChannelResponse.HasObjectId && (!this.HasObjectId || this.ObjectId.Equals(subscribeChannelResponse.ObjectId)));
        }