public static GetEBalanceRequest DeserializeLengthDelimited(Stream stream, GetEBalanceRequest instance) { long position = (long)ProtocolParser.ReadUInt32(stream); position += stream.Position; return(GetEBalanceRequest.Deserialize(stream, instance, position)); }
public static GetEBalanceRequest DeserializeLengthDelimited(Stream stream) { GetEBalanceRequest getEBalanceRequest = new GetEBalanceRequest(); GetEBalanceRequest.DeserializeLengthDelimited(stream, getEBalanceRequest); return(getEBalanceRequest); }
public static GetEBalanceRequest DeserializeLengthDelimited(Stream stream, GetEBalanceRequest instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.get_Position(); return(GetEBalanceRequest.Deserialize(stream, instance, num)); }
public static GetEBalanceRequest Deserialize(Stream stream, GetEBalanceRequest 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 != 10) { if (num2 != 18) { 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.CurrencyHomeRegion = ProtocolParser.ReadUInt32(stream); } } else { instance.Currency = ProtocolParser.ReadString(stream); } } else if (instance.AccountId == null) { instance.AccountId = AccountId.DeserializeLengthDelimited(stream); } else { AccountId.DeserializeLengthDelimited(stream, instance.AccountId); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static GetEBalanceRequest Deserialize(Stream stream, GetEBalanceRequest 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 == 10) { if (instance.AccountId != null) { bnet.protocol.account.AccountId.DeserializeLengthDelimited(stream, instance.AccountId); } else { instance.AccountId = bnet.protocol.account.AccountId.DeserializeLengthDelimited(stream); } } else if (num == 18) { instance.Currency = ProtocolParser.ReadString(stream); } else if (num == 24) { instance.CurrencyHomeRegion = 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 void Serialize(Stream stream, GetEBalanceRequest instance) { if (instance.AccountId == null) { throw new ArgumentNullException("AccountId", "Required by proto specification."); } stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.AccountId.GetSerializedSize()); bnet.protocol.account.AccountId.Serialize(stream, instance.AccountId); if (instance.Currency == null) { throw new ArgumentNullException("Currency", "Required by proto specification."); } stream.WriteByte(18); ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.Currency)); if (instance.HasCurrencyHomeRegion) { stream.WriteByte(24); ProtocolParser.WriteUInt32(stream, instance.CurrencyHomeRegion); } }
public override bool Equals(object obj) { GetEBalanceRequest getEBalanceRequest = obj as GetEBalanceRequest; if (getEBalanceRequest == null) { return(false); } if (!this.AccountId.Equals(getEBalanceRequest.AccountId)) { return(false); } if (!this.Currency.Equals(getEBalanceRequest.Currency)) { return(false); } if (this.HasCurrencyHomeRegion == getEBalanceRequest.HasCurrencyHomeRegion && (!this.HasCurrencyHomeRegion || this.CurrencyHomeRegion.Equals(getEBalanceRequest.CurrencyHomeRegion))) { return(true); } return(false); }
public static GetEBalanceRequest Deserialize(Stream stream, GetEBalanceRequest instance) { return(GetEBalanceRequest.Deserialize(stream, instance, (long)-1)); }
public void Deserialize(Stream stream) { GetEBalanceRequest.Deserialize(stream, this); }
public override bool Equals(object obj) { GetEBalanceRequest getEBalanceRequest = obj as GetEBalanceRequest; return(getEBalanceRequest != null && this.AccountId.Equals(getEBalanceRequest.AccountId) && this.Currency.Equals(getEBalanceRequest.Currency) && this.HasCurrencyHomeRegion == getEBalanceRequest.HasCurrencyHomeRegion && (!this.HasCurrencyHomeRegion || this.CurrencyHomeRegion.Equals(getEBalanceRequest.CurrencyHomeRegion))); }