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

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

            FindClientResponse.DeserializeLengthDelimited(stream, findClientResponse);
            return(findClientResponse);
        }
Пример #3
0
        public static FindClientResponse DeserializeLengthDelimited(Stream stream, FindClientResponse instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(FindClientResponse.Deserialize(stream, instance, num));
        }
Пример #4
0
 public static void Serialize(Stream stream, FindClientResponse instance)
 {
     stream.WriteByte(8);
     ProtocolParser.WriteUInt32(stream, instance.Label);
     if (instance.HasClientProcessId)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.ClientProcessId.GetSerializedSize());
         ProcessId.Serialize(stream, instance.ClientProcessId);
     }
 }
Пример #5
0
 public static FindClientResponse Deserialize(Stream stream, FindClientResponse instance, long limit)
 {
     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 != 8)
             {
                 if (num2 != 18)
                 {
                     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 if (instance.ClientProcessId == null)
                 {
                     instance.ClientProcessId = ProcessId.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     ProcessId.DeserializeLengthDelimited(stream, instance.ClientProcessId);
                 }
             }
             else
             {
                 instance.Label = ProtocolParser.ReadUInt32(stream);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Пример #6
0
 public static FindClientResponse Deserialize(Stream stream, FindClientResponse instance, long limit)
 {
     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 == 8)
             {
                 instance.Label = ProtocolParser.ReadUInt32(stream);
             }
             else if (num != 18)
             {
                 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.ClientProcessId != null)
             {
                 ProcessId.DeserializeLengthDelimited(stream, instance.ClientProcessId);
             }
             else
             {
                 instance.ClientProcessId = ProcessId.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
Пример #7
0
        public override bool Equals(object obj)
        {
            FindClientResponse findClientResponse = obj as FindClientResponse;

            if (findClientResponse == null)
            {
                return(false);
            }
            if (!this.Label.Equals(findClientResponse.Label))
            {
                return(false);
            }
            if (this.HasClientProcessId == findClientResponse.HasClientProcessId && (!this.HasClientProcessId || this.ClientProcessId.Equals(findClientResponse.ClientProcessId)))
            {
                return(true);
            }
            return(false);
        }
Пример #8
0
 public static FindClientResponse Deserialize(Stream stream, FindClientResponse instance)
 {
     return(FindClientResponse.Deserialize(stream, instance, (long)-1));
 }
Пример #9
0
 public void Deserialize(Stream stream)
 {
     FindClientResponse.Deserialize(stream, this);
 }
Пример #10
0
        public override bool Equals(object obj)
        {
            FindClientResponse findClientResponse = obj as FindClientResponse;

            return(findClientResponse != null && this.Label.Equals(findClientResponse.Label) && this.HasClientProcessId == findClientResponse.HasClientProcessId && (!this.HasClientProcessId || this.ClientProcessId.Equals(findClientResponse.ClientProcessId)));
        }