public static SendChallengeToUserResponse Deserialize(Stream stream, SendChallengeToUserResponse 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.Id = ProtocolParser.ReadUInt32(stream); } } if (stream.Position == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static SendChallengeToUserResponse DeserializeLengthDelimited(Stream stream) { SendChallengeToUserResponse sendChallengeToUserResponse = new SendChallengeToUserResponse(); SendChallengeToUserResponse.DeserializeLengthDelimited(stream, sendChallengeToUserResponse); return(sendChallengeToUserResponse); }
public static SendChallengeToUserResponse DeserializeLengthDelimited(Stream stream, SendChallengeToUserResponse instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.Position; return(SendChallengeToUserResponse.Deserialize(stream, instance, num)); }
public static void Serialize(Stream stream, SendChallengeToUserResponse instance) { if (instance.HasId) { stream.WriteByte(8); ProtocolParser.WriteUInt32(stream, instance.Id); } }
public override bool Equals(object obj) { SendChallengeToUserResponse sendChallengeToUserResponse = obj as SendChallengeToUserResponse; if (sendChallengeToUserResponse == null) { return(false); } if (this.HasId == sendChallengeToUserResponse.HasId && (!this.HasId || this.Id.Equals(sendChallengeToUserResponse.Id))) { return(true); } return(false); }
public static SendChallengeToUserResponse Deserialize(Stream stream, SendChallengeToUserResponse instance) { return(SendChallengeToUserResponse.Deserialize(stream, instance, -1L)); }
public void Deserialize(Stream stream) { SendChallengeToUserResponse.Deserialize(stream, this); }
public override bool Equals(object obj) { SendChallengeToUserResponse sendChallengeToUserResponse = obj as SendChallengeToUserResponse; return(sendChallengeToUserResponse != null && this.HasId == sendChallengeToUserResponse.HasId && (!this.HasId || this.Id.Equals(sendChallengeToUserResponse.Id))); }