public static ModuleNotification DeserializeLengthDelimited(Stream stream) { ModuleNotification moduleNotification = new ModuleNotification(); ModuleNotification.DeserializeLengthDelimited(stream, moduleNotification); return(moduleNotification); }
public static ModuleNotification DeserializeLengthDelimited(Stream stream, ModuleNotification instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.get_Position(); return(ModuleNotification.Deserialize(stream, instance, num)); }
public static ModuleNotification DeserializeLengthDelimited(Stream stream, ModuleNotification instance) { long position = (long)ProtocolParser.ReadUInt32(stream); position += stream.Position; return(ModuleNotification.Deserialize(stream, instance, position)); }
public static void Serialize(Stream stream, ModuleNotification instance) { if (instance.HasModuleId) { stream.WriteByte(16); ProtocolParser.WriteUInt64(stream, (ulong)((long)instance.ModuleId)); } if (instance.HasResult) { stream.WriteByte(24); ProtocolParser.WriteUInt32(stream, instance.Result); } }
public static ModuleNotification Deserialize(Stream stream, ModuleNotification 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 != 16) { if (num2 != 24) { 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.Result = ProtocolParser.ReadUInt32(stream); } } else { instance.ModuleId = (int)ProtocolParser.ReadUInt64(stream); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public override bool Equals(object obj) { ModuleNotification moduleNotification = obj as ModuleNotification; if (moduleNotification == null) { return(false); } if (this.HasModuleId != moduleNotification.HasModuleId || this.HasModuleId && !this.ModuleId.Equals(moduleNotification.ModuleId)) { return(false); } if (this.HasResult == moduleNotification.HasResult && (!this.HasResult || this.Result.Equals(moduleNotification.Result))) { return(true); } return(false); }
public static ModuleNotification Deserialize(Stream stream, ModuleNotification 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 == 16) { instance.ModuleId = (int)ProtocolParser.ReadUInt64(stream); } else if (num == 24) { instance.Result = ProtocolParser.ReadUInt32(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 ModuleNotification Deserialize(Stream stream, ModuleNotification instance) { return(ModuleNotification.Deserialize(stream, instance, -1L)); }
public void Deserialize(Stream stream) { ModuleNotification.Deserialize(stream, this); }
public override bool Equals(object obj) { ModuleNotification moduleNotification = obj as ModuleNotification; return(moduleNotification != null && this.HasModuleId == moduleNotification.HasModuleId && (!this.HasModuleId || this.ModuleId.Equals(moduleNotification.ModuleId)) && this.HasResult == moduleNotification.HasResult && (!this.HasResult || this.Result.Equals(moduleNotification.Result))); }