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