public static FindChannelResponse DeserializeLengthDelimited(Stream stream, FindChannelResponse instance) { long position = (long)ProtocolParser.ReadUInt32(stream); position += stream.Position; return(FindChannelResponse.Deserialize(stream, instance, position)); }
public static FindChannelResponse DeserializeLengthDelimited(Stream stream) { FindChannelResponse findChannelResponse = new FindChannelResponse(); FindChannelResponse.DeserializeLengthDelimited(stream, findChannelResponse); return(findChannelResponse); }
public static FindChannelResponse DeserializeLengthDelimited(Stream stream, FindChannelResponse instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.get_Position(); return(FindChannelResponse.Deserialize(stream, instance, num)); }
public static void Serialize(Stream stream, FindChannelResponse instance) { if (instance.Channel.Count > 0) { foreach (ChannelDescription channel in instance.Channel) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, channel.GetSerializedSize()); ChannelDescription.Serialize(stream, channel); } } }
public static void Serialize(Stream stream, FindChannelResponse instance) { if (instance.Channel.get_Count() > 0) { using (List <ChannelDescription> .Enumerator enumerator = instance.Channel.GetEnumerator()) { while (enumerator.MoveNext()) { ChannelDescription current = enumerator.get_Current(); stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, current.GetSerializedSize()); ChannelDescription.Serialize(stream, current); } } } }
public static FindChannelResponse Deserialize(Stream stream, FindChannelResponse instance, long limit) { if (instance.Channel == null) { instance.Channel = new List <ChannelDescription>(); } 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.Channel.Add(ChannelDescription.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); }
public static FindChannelResponse Deserialize(Stream stream, FindChannelResponse instance, long limit) { if (instance.Channel == null) { instance.Channel = new List <ChannelDescription>(); } 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.Channel.Add(ChannelDescription.DeserializeLengthDelimited(stream)); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public override bool Equals(object obj) { FindChannelResponse findChannelResponse = obj as FindChannelResponse; if (findChannelResponse == null) { return(false); } if (this.Channel.Count != findChannelResponse.Channel.Count) { return(false); } for (int i = 0; i < this.Channel.Count; i++) { if (!this.Channel[i].Equals(findChannelResponse.Channel[i])) { return(false); } } return(true); }
public override bool Equals(object obj) { FindChannelResponse findChannelResponse = obj as FindChannelResponse; if (findChannelResponse == null) { return(false); } if (this.Channel.get_Count() != findChannelResponse.Channel.get_Count()) { return(false); } for (int i = 0; i < this.Channel.get_Count(); i++) { if (!this.Channel.get_Item(i).Equals(findChannelResponse.Channel.get_Item(i))) { return(false); } } return(true); }
public static FindChannelResponse Deserialize(Stream stream, FindChannelResponse instance) { return(FindChannelResponse.Deserialize(stream, instance, (long)-1)); }
public void Deserialize(Stream stream) { FindChannelResponse.Deserialize(stream, this); }