IBuilderLite IBuilderLite.WeakMergeFrom(ICodedInputStream input) { return MergeFrom(input); }
public override InnerFiled.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { this.PrepareBuilder(); UnknownFieldSet.Builder builder = null; uint num; string text; while (input.ReadTag(out num, out text)) { if (num == 0u && text != null) { int num2 = Array.BinarySearch <string>(InnerFiled._innerFiledFieldNames, text, StringComparer.Ordinal); if (num2 < 0) { if (builder == null) { builder = UnknownFieldSet.CreateBuilder(this.UnknownFields); } this.ParseUnknownField(input, builder, extensionRegistry, num, text); continue; } num = InnerFiled._innerFiledFieldTags[num2]; } if (num <= 10u) { if (num == 0u) { throw InvalidProtocolBufferException.InvalidTag(); } if (num == 10u) { this.result.hasKey = input.ReadString(ref this.result.key_); continue; } } else { if (num == 18u) { this.result.hasVal = input.ReadString(ref this.result.val_); continue; } if (num == 24u) { object obj; if (input.ReadEnum <InnerFiled.Types.Type>(ref this.result.type_, out obj)) { this.result.hasType = true; continue; } if (obj is int) { if (builder == null) { builder = UnknownFieldSet.CreateBuilder(this.UnknownFields); } builder.MergeVarintField(3, (ulong)((long)((int)obj))); continue; } continue; } } if (WireFormat.IsEndGroupTag(num)) { if (builder != null) { this.UnknownFields = builder.Build(); } return(this); } if (builder == null) { builder = UnknownFieldSet.CreateBuilder(this.UnknownFields); } this.ParseUnknownField(input, builder, extensionRegistry, num, text); } if (builder != null) { this.UnknownFields = builder.Build(); } return(this); }
public static InnerFiled ParseFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { return(InnerFiled.CreateBuilder().MergeFrom(input, extensionRegistry).BuildParsed()); }
public static RustProto.Item ParseFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { return(RustProto.Item.CreateBuilder().MergeFrom(input, extensionRegistry).BuildParsed()); }
public override RustProto.Item.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { uint num; string str; this.PrepareBuilder(); UnknownFieldSet.Builder builder = null; while (input.ReadTag(out num, out str)) { if (num == 0 && str != null) { int num1 = Array.BinarySearch <string>(RustProto.Item._itemFieldNames, str, StringComparer.Ordinal); if (num1 < 0) { if (builder == null) { builder = UnknownFieldSet.CreateBuilder(this.UnknownFields); } this.ParseUnknownField(input, builder, extensionRegistry, num, str); continue; } else { num = RustProto.Item._itemFieldTags[num1]; } } uint num2 = num; if (num2 == 0) { throw InvalidProtocolBufferException.InvalidTag(); } if (num2 == 8) { this.result.hasId = input.ReadInt32(ref this.result.id_); } else if (num2 == 18) { this.result.hasName = input.ReadString(ref this.result.name_); } else if (num2 == 24) { this.result.hasSlot = input.ReadInt32(ref this.result.slot_); } else if (num2 == 32) { this.result.hasCount = input.ReadInt32(ref this.result.count_); } else if (num2 == 42) { input.ReadMessageArray <RustProto.Item>(num, str, this.result.subitem_, RustProto.Item.DefaultInstance, extensionRegistry); } else if (num2 == 48) { this.result.hasSubslots = input.ReadInt32(ref this.result.subslots_); } else if (num2 == 61) { this.result.hasCondition = input.ReadFloat(ref this.result.condition_); } else if (num2 == 69) { this.result.hasMaxcondition = input.ReadFloat(ref this.result.maxcondition_); } else { if (WireFormat.IsEndGroupTag(num)) { if (builder != null) { this.UnknownFields = builder.Build(); } return(this); } if (builder == null) { builder = UnknownFieldSet.CreateBuilder(this.UnknownFields); } this.ParseUnknownField(input, builder, extensionRegistry, num, str); } } if (builder != null) { this.UnknownFields = builder.Build(); } return(this); }
/// <summary> /// Like <see cref="MergeFrom(ICodedInputStream, ExtensionRegistry, IBuilder)" /> /// but parses a single field. /// </summary> /// <param name="input">The input to read the field from</param> /// <param name="extensionRegistry">Registry to use when an extension field is encountered</param> /// <param name="builder">Builder to merge field into, if it's a known field</param> /// <param name="tag">The tag, which should already have been read from the input</param> /// <returns>true unless the tag is an end-group tag</returns> internal bool MergeFieldFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry, IBuilder builder, uint tag, string fieldName) { if (tag == 0 && fieldName != null) { FieldDescriptor fieldByName = builder.DescriptorForType.FindFieldByName(fieldName); if (fieldByName != null) { tag = WireFormat.MakeTag(fieldByName); } else { ExtensionInfo extension = extensionRegistry.FindByName(builder.DescriptorForType, fieldName); if (extension != null) { tag = WireFormat.MakeTag(extension.Descriptor); } } } MessageDescriptor type = builder.DescriptorForType; if (type.Options.MessageSetWireFormat && tag == WireFormat.MessageSetTag.ItemStart) { MergeMessageSetExtensionFromCodedStream(input, extensionRegistry, builder); return true; } WireFormat.WireType wireType = WireFormat.GetTagWireType(tag); int fieldNumber = WireFormat.GetTagFieldNumber(tag); FieldDescriptor field; IMessageLite defaultFieldInstance = null; if (type.IsExtensionNumber(fieldNumber)) { ExtensionInfo extension = extensionRegistry[type, fieldNumber]; if (extension == null) { field = null; } else { field = extension.Descriptor; defaultFieldInstance = extension.DefaultInstance; } } else { field = type.FindFieldByNumber(fieldNumber); } // Unknown field or wrong wire type. Skip. if (field == null) { return MergeFieldFrom(tag, input); } if (wireType != WireFormat.GetWireType(field)) { WireFormat.WireType expectedType = WireFormat.GetWireType(field.FieldType); if (wireType == expectedType) { //Allowed as of 2.3, this is unpacked data for a packed array } else if (field.IsRepeated && wireType == WireFormat.WireType.LengthDelimited && (expectedType == WireFormat.WireType.Varint || expectedType == WireFormat.WireType.Fixed32 || expectedType == WireFormat.WireType.Fixed64)) { //Allowed as of 2.3, this is packed data for an unpacked array } else { return MergeFieldFrom(tag, input); } } switch (field.FieldType) { case FieldType.Group: case FieldType.Message: { IBuilderLite subBuilder = (defaultFieldInstance != null) ? defaultFieldInstance.WeakCreateBuilderForType() : builder.CreateBuilderForField(field); if (!field.IsRepeated) { subBuilder.WeakMergeFrom((IMessageLite) builder[field]); if (field.FieldType == FieldType.Group) { input.ReadGroup(field.FieldNumber, subBuilder, extensionRegistry); } else { input.ReadMessage(subBuilder, extensionRegistry); } builder[field] = subBuilder.WeakBuild(); } else { List<IMessageLite> list = new List<IMessageLite>(); if (field.FieldType == FieldType.Group) { input.ReadGroupArray(tag, fieldName, list, subBuilder.WeakDefaultInstanceForType, extensionRegistry); } else { input.ReadMessageArray(tag, fieldName, list, subBuilder.WeakDefaultInstanceForType, extensionRegistry); } foreach (IMessageLite m in list) { builder.WeakAddRepeatedField(field, m); } return true; } break; } case FieldType.Enum: { if (!field.IsRepeated) { object unknown; IEnumLite value = null; if (input.ReadEnum(ref value, out unknown, field.EnumType)) { builder[field] = value; } else if (unknown is int) { MergeVarintField(fieldNumber, (ulong) (int) unknown); } } else { ICollection<object> unknown; List<IEnumLite> list = new List<IEnumLite>(); input.ReadEnumArray(tag, fieldName, list, out unknown, field.EnumType); foreach (IEnumLite en in list) { builder.WeakAddRepeatedField(field, en); } if (unknown != null) { foreach (object oval in unknown) { if (oval is int) { MergeVarintField(fieldNumber, (ulong) (int) oval); } } } } break; } default: { if (!field.IsRepeated) { object value = null; if (input.ReadPrimitiveField(field.FieldType, ref value)) { builder[field] = value; } } else { List<object> list = new List<object>(); input.ReadPrimitiveArray(field.FieldType, tag, fieldName, list); foreach (object oval in list) { builder.WeakAddRepeatedField(field, oval); } } break; } } return true; }
// Token: 0x0600002A RID: 42 RVA: 0x0000233E File Offset: 0x0000053E public static GtAuth ParseFrom(ICodedInputStream input) { return(CreateBuilder().MergeFrom(input).BuildParsed()); }
public override objectNGCInstance.Builder MergeFrom(ICodedInputStream input) { return(this.MergeFrom(input, ExtensionRegistry.get_Empty())); }
public override objectNGCInstance.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { uint num; string str; this.PrepareBuilder(); UnknownFieldSet.Builder builder = null; while (input.ReadTag(ref num, ref str)) { if ((num == 0) && (str != null)) { int index = Array.BinarySearch <string>(objectNGCInstance._objectNGCInstanceFieldNames, str, StringComparer.Ordinal); if (index >= 0) { num = objectNGCInstance._objectNGCInstanceFieldTags[index]; } else { if (builder == null) { builder = UnknownFieldSet.CreateBuilder(this.get_UnknownFields()); } this.ParseUnknownField(input, builder, extensionRegistry, num, str); continue; } } switch (num) { case 0: throw InvalidProtocolBufferException.InvalidTag(); case 8: { this.result.hasID = input.ReadInt32(ref this.result.iD_); continue; } case 0x12: break; default: { if (WireFormat.IsEndGroupTag(num)) { if (builder != null) { this.set_UnknownFields(builder.Build()); } return(this); } if (builder == null) { builder = UnknownFieldSet.CreateBuilder(this.get_UnknownFields()); } this.ParseUnknownField(input, builder, extensionRegistry, num, str); continue; } } this.result.hasData = input.ReadBytes(ref this.result.data_); } if (builder != null) { this.set_UnknownFields(builder.Build()); } return(this); }
public static PushListResult ParseFrom(ICodedInputStream input) { return(PushListResult.CreateBuilder().MergeFrom(input).BuildParsed()); }
public static PushListResult ParseFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { return(PushListResult.CreateBuilder().MergeFrom(input, extensionRegistry).BuildParsed()); }
public override PushListResult.Builder MergeFrom(ICodedInputStream input) { return(this.MergeFrom(input, ExtensionRegistry.Empty)); }
public override SendMessageToWXReq.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { uint num; string str; this.PrepareBuilder(); while (input.ReadTag(out num, out str)) { if ((num == 0) && (str != null)) { int index = Array.BinarySearch <string>(SendMessageToWXReq._sendMessageToWXReqFieldNames, str, StringComparer.Ordinal); if (index >= 0) { num = SendMessageToWXReq._sendMessageToWXReqFieldTags[index]; } else { this.ParseUnknownField(input, extensionRegistry, num, str); continue; } } switch (num) { case 0: throw InvalidProtocolBufferException.InvalidTag(); case 10: { BaseReqP.Builder builder = BaseReqP.CreateBuilder(); if (this.result.hasBase) { builder.MergeFrom(this.Base); } input.ReadMessage(builder, extensionRegistry); this.Base = builder.BuildPartial(); continue; } case 0x12: { WXMessageP.Builder builder2 = WXMessageP.CreateBuilder(); if (this.result.hasMsg) { builder2.MergeFrom(this.Msg); } input.ReadMessage(builder2, extensionRegistry); this.Msg = builder2.BuildPartial(); continue; } case 0x18: break; default: { if (WireFormat.IsEndGroupTag(num)) { return(this); } this.ParseUnknownField(input, extensionRegistry, num, str); continue; } } this.result.hasScene = input.ReadUInt32(ref this.result.scene_); } return(this); }
// Token: 0x060006C0 RID: 1728 RVA: 0x00010578 File Offset: 0x0000E778 public override Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { PrepareBuilder(); UnknownFieldSet.Builder builder = null; while (input.ReadTag(out uint num, out string text)) { if (num == 0U && text != null) { int num2 = Array.BinarySearch(_gtAuthFieldNames, text, StringComparer.Ordinal); if (num2 < 0) { if (builder == null) { builder = UnknownFieldSet.CreateBuilder(UnknownFields); } ParseUnknownField(input, builder, extensionRegistry, num, text); continue; } num = _gtAuthFieldTags[num2]; } if (num <= 10U) { if (num == 0U) { throw InvalidProtocolBufferException.InvalidTag(); } if (num == 10U) { result.HasSign = input.ReadString(ref result.sign_); continue; } } else { if (num == 18U) { result.HasAppkey = input.ReadString(ref result.appkey_); continue; } if (num == 24U) { result.HasTimestamp = input.ReadInt64(ref result.timestamp_); continue; } if (num == 34U) { result.HasSeqId = input.ReadString(ref result.seqId_); continue; } } if (WireFormat.IsEndGroupTag(num)) { if (builder != null) { UnknownFields = builder.Build(); } return(this); } if (builder == null) { builder = UnknownFieldSet.CreateBuilder(UnknownFields); } ParseUnknownField(input, builder, extensionRegistry, num, text); } if (builder != null) { UnknownFields = builder.Build(); } return(this); }
/// <summary> /// Parses an UnknownFieldSet from the given input. /// </summary> public static UnknownFieldSet ParseFrom(ICodedInputStream input) { return CreateBuilder().MergeFrom(input).Build(); }
public static objectNGCInstance ParseFrom(ICodedInputStream input) { return(CreateBuilder().MergeFrom(input).BuildParsed()); }
/// <summary> /// Parse a single field from <paramref name="input"/> and merge it /// into this set. /// </summary> /// <param name="tag">The field's tag number, which was already parsed.</param> /// <param name="input">The coded input stream containing the field</param> /// <returns>false if the tag is an "end group" tag, true otherwise</returns> public bool MergeFieldFrom(uint tag, ICodedInputStream input) { if (tag == 0) { input.SkipField(); return true; } int number = WireFormat.GetTagFieldNumber(tag); switch (WireFormat.GetTagWireType(tag)) { case WireFormat.WireType.Varint: { ulong uint64 = 0; if (input.ReadUInt64(ref uint64)) { GetFieldBuilder(number).AddVarint(uint64); } return true; } case WireFormat.WireType.Fixed32: { uint uint32 = 0; if (input.ReadFixed32(ref uint32)) { GetFieldBuilder(number).AddFixed32(uint32); } return true; } case WireFormat.WireType.Fixed64: { ulong uint64 = 0; if (input.ReadFixed64(ref uint64)) { GetFieldBuilder(number).AddFixed64(uint64); } return true; } case WireFormat.WireType.LengthDelimited: { ByteString bytes = null; if (input.ReadBytes(ref bytes)) { GetFieldBuilder(number).AddLengthDelimited(bytes); } return true; } case WireFormat.WireType.StartGroup: { Builder subBuilder = CreateBuilder(); #pragma warning disable 0612 input.ReadUnknownGroup(number, subBuilder); #pragma warning restore 0612 GetFieldBuilder(number).AddGroup(subBuilder.Build()); return true; } case WireFormat.WireType.EndGroup: return false; default: throw InvalidProtocolBufferException.InvalidWireType(); } }
public static objectNGCInstance ParseFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { return(CreateBuilder().MergeFrom(input, extensionRegistry).BuildParsed()); }
public IMessageLite CallMethod(string methodName, ICodedInputStream input, ExtensionRegistry registry) { using (RpcCallContext.Current.Impersonate()) return _next.CallMethod(methodName, input, registry); }
public override AddMsg.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { uint num; string str; this.PrepareBuilder(); while (input.ReadTag(out num, out str)) { if ((num == 0) && (str != null)) { int index = Array.BinarySearch <string>(AddMsg._addMsgFieldNames, str, StringComparer.Ordinal); if (index >= 0) { num = AddMsg._addMsgFieldTags[index]; } else { this.ParseUnknownField(input, extensionRegistry, num, str); continue; } } switch (num) { case 0x1a: { SKBuiltinString_t.Builder builder2 = SKBuiltinString_t.CreateBuilder(); if (this.result.hasToUserName) { builder2.MergeFrom(this.ToUserName); } input.ReadMessage(builder2, extensionRegistry); this.ToUserName = builder2.BuildPartial(); continue; } case 0x20: { this.result.hasMsgType = input.ReadInt32(ref this.result.msgType_); continue; } case 0x2a: { SKBuiltinString_t.Builder builder3 = SKBuiltinString_t.CreateBuilder(); if (this.result.hasContent) { builder3.MergeFrom(this.Content); } input.ReadMessage(builder3, extensionRegistry); this.Content = builder3.BuildPartial(); continue; } case 0: throw InvalidProtocolBufferException.InvalidTag(); case 8: { this.result.hasMsgId = input.ReadInt32(ref this.result.msgId_); continue; } case 0x12: { SKBuiltinString_t.Builder builder = SKBuiltinString_t.CreateBuilder(); if (this.result.hasFromUserName) { builder.MergeFrom(this.FromUserName); } input.ReadMessage(builder, extensionRegistry); this.FromUserName = builder.BuildPartial(); continue; } case 0x30: { this.result.hasStatus = input.ReadUInt32(ref this.result.status_); continue; } case 0x38: { this.result.hasImgStatus = input.ReadUInt32(ref this.result.imgStatus_); continue; } case 0x42: { SKBuiltinBuffer_t.Builder builder4 = SKBuiltinBuffer_t.CreateBuilder(); if (this.result.hasImgBuf) { builder4.MergeFrom(this.ImgBuf); } input.ReadMessage(builder4, extensionRegistry); this.ImgBuf = builder4.BuildPartial(); continue; } case 0x48: { this.result.hasCreateTime = input.ReadUInt32(ref this.result.createTime_); continue; } case 0x52: { this.result.hasMsgSource = input.ReadString(ref this.result.msgSource_); continue; } case 90: { this.result.hasPushContent = input.ReadString(ref this.result.pushContent_); continue; } case 0x60: break; default: { if (WireFormat.IsEndGroupTag(num)) { return(this); } this.ParseUnknownField(input, extensionRegistry, num, str); continue; } } this.result.hasNewMsgId = input.ReadInt64(ref this.result.newMsgId_); } return(this); }
public static RustProto.Item ParseFrom(ICodedInputStream input) { return(RustProto.Item.CreateBuilder().MergeFrom(input).BuildParsed()); }
public override CDNDnsInfo.Builder MergeFrom(ICodedInputStream input) { return(this.MergeFrom(input, ExtensionRegistry.Empty)); }
public override RustProto.Item.Builder MergeFrom(ICodedInputStream input) { return(this.MergeFrom(input, ExtensionRegistry.Empty)); }
public override CDNDnsInfo.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { uint num; string str; this.PrepareBuilder(); while (input.ReadTag(out num, out str)) { if ((num == 0) && (str != null)) { int index = Array.BinarySearch <string>(CDNDnsInfo._cDNDnsInfoFieldNames, str, StringComparer.Ordinal); if (index >= 0) { num = CDNDnsInfo._cDNDnsInfoFieldTags[index]; } else { this.ParseUnknownField(input, extensionRegistry, num, str); continue; } } switch (num) { case 0x18: { this.result.hasExpireTime = input.ReadUInt32(ref this.result.expireTime_); continue; } case 0x20: { this.result.hasFrontID = input.ReadInt32(ref this.result.frontID_); continue; } case 40: { this.result.hasFrontIPCount = input.ReadInt32(ref this.result.frontIPCount_); continue; } case 0: throw InvalidProtocolBufferException.InvalidTag(); case 8: { this.result.hasVer = input.ReadUInt32(ref this.result.ver_); continue; } case 0x10: { this.result.hasUin = input.ReadUInt32(ref this.result.uin_); continue; } case 50: { input.ReadMessageArray <SKBuiltinString_t>(num, str, this.result.frontIPList_, SKBuiltinString_t.DefaultInstance, extensionRegistry); continue; } case 0x3a: { this.result.hasZoneDomain = input.ReadString(ref this.result.zoneDomain_); continue; } case 0x42: { SKBuiltinBuffer_t.Builder builder = SKBuiltinBuffer_t.CreateBuilder(); if (this.result.hasAuthKey) { builder.MergeFrom(this.AuthKey); } input.ReadMessage(builder, extensionRegistry); this.AuthKey = builder.BuildPartial(); continue; } case 0x48: { this.result.hasZoneID = input.ReadInt32(ref this.result.zoneID_); continue; } case 80: { this.result.hasZoneIPCount = input.ReadInt32(ref this.result.zoneIPCount_); continue; } case 90: break; default: { if (WireFormat.IsEndGroupTag(num)) { return(this); } this.ParseUnknownField(input, extensionRegistry, num, str); continue; } } input.ReadMessageArray <SKBuiltinString_t>(num, str, this.result.zoneIPList_, SKBuiltinString_t.DefaultInstance, extensionRegistry); } return(this); }
public override InnerFiled.Builder MergeFrom(ICodedInputStream input) { return(this.MergeFrom(input, ExtensionRegistry.Empty)); }
public static MMPMessage ParseFrom(ICodedInputStream input) { return(MMPMessage.CreateBuilder().MergeFrom(input).BuildParsed()); }
public static InnerFiled ParseFrom(ICodedInputStream input) { return(InnerFiled.CreateBuilder().MergeFrom(input).BuildParsed()); }
public override MMPMessage.Builder MergeFrom(ICodedInputStream input) { return(this.MergeFrom(input, ExtensionRegistry.Empty)); }
public override objectDoor.Builder MergeFrom(ICodedInputStream input) { return(this.MergeFrom(input, ExtensionRegistry.Empty)); }
public override MMPMessage.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { this.PrepareBuilder(); UnknownFieldSet.Builder builder = null; uint num; string text; while (input.ReadTag(out num, out text)) { if (num == 0u && text != null) { int num2 = Array.BinarySearch <string>(MMPMessage._mMPMessageFieldNames, text, StringComparer.Ordinal); if (num2 < 0) { if (builder == null) { builder = UnknownFieldSet.CreateBuilder(this.UnknownFields); } this.ParseUnknownField(input, builder, extensionRegistry, num, text); continue; } num = MMPMessage._mMPMessageFieldTags[num2]; } if (num <= 40u) { if (num <= 18u) { if (num == 0u) { throw InvalidProtocolBufferException.InvalidTag(); } if (num == 18u) { Transparent.Builder builder2 = Transparent.CreateBuilder(); if (this.result.hasTransparent) { builder2.MergeFrom(this.Transparent); } input.ReadMessage(builder2, extensionRegistry); this.Transparent = builder2.BuildPartial(); continue; } } else { if (num == 26u) { this.result.hasExtraData = input.ReadString(ref this.result.extraData_); continue; } if (num == 32u) { this.result.hasMsgType = input.ReadInt32(ref this.result.msgType_); continue; } if (num == 40u) { this.result.hasMsgTraceFlag = input.ReadInt32(ref this.result.msgTraceFlag_); continue; } } } else if (num <= 56u) { if (num == 48u) { this.result.hasMsgOfflineExpire = input.ReadInt64(ref this.result.msgOfflineExpire_); continue; } if (num == 56u) { this.result.hasIsOffline = input.ReadBool(ref this.result.isOffline_); continue; } } else { if (num == 64u) { this.result.hasPriority = input.ReadInt32(ref this.result.priority_); continue; } if (num == 74u) { this.result.hasCdnUrl = input.ReadString(ref this.result.cdnUrl_); continue; } if (num == 80u) { this.result.hasIsSync = input.ReadBool(ref this.result.isSync_); continue; } } if (WireFormat.IsEndGroupTag(num)) { if (builder != null) { this.UnknownFields = builder.Build(); } return(this); } if (builder == null) { builder = UnknownFieldSet.CreateBuilder(this.UnknownFields); } this.ParseUnknownField(input, builder, extensionRegistry, num, text); } if (builder != null) { this.UnknownFields = builder.Build(); } return(this); }
IBuilderLite IBuilderLite.WeakMergeFrom(ICodedInputStream input, ExtensionRegistry registry) { return MergeFrom(input); }
// Token: 0x0600024C RID: 588 RVA: 0x00005728 File Offset: 0x00003928 public static PushMMPAppMessage ParseFrom(ICodedInputStream input) { return(CreateBuilder().MergeFrom(input).BuildParsed()); }
/// <summary> /// Parse an entire message from <paramref name="input"/> and merge /// its fields into this set. /// </summary> public Builder MergeFrom(ICodedInputStream input) { uint tag; string name; while (input.ReadTag(out tag, out name)) { if (tag == 0) { if (input.SkipField()) { continue; //can't merge unknown without field tag } break; } if (!MergeFieldFrom(tag, input)) { break; } } return this; }
// Token: 0x0600024D RID: 589 RVA: 0x0000573A File Offset: 0x0000393A public static PushMMPAppMessage ParseFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { return(CreateBuilder().MergeFrom(input, extensionRegistry).BuildParsed()); }
internal void MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry, IBuilder builder) { uint tag; string name; while (input.ReadTag(out tag, out name)) { if (tag == 0 && name != null) { FieldDescriptor fieldByName = builder.DescriptorForType.FindFieldByName(name); if (fieldByName != null) { tag = WireFormat.MakeTag(fieldByName); } else { ExtensionInfo extension = extensionRegistry.FindByName(builder.DescriptorForType, name); if (extension != null) { tag = WireFormat.MakeTag(extension.Descriptor); } } } if (tag == 0) { if (input.SkipField()) { continue; //can't merge unknown without field tag } break; } if (!MergeFieldFrom(input, extensionRegistry, builder, tag, name)) { // end group tag break; } } }
// Token: 0x060008F1 RID: 2289 RVA: 0x000155DA File Offset: 0x000137DA public override Builder MergeFrom(ICodedInputStream input) { return(MergeFrom(input, ExtensionRegistry.Empty)); }
/// <summary> /// Called by MergeFieldFrom to parse a MessageSet extension. /// </summary> private void MergeMessageSetExtensionFromCodedStream(ICodedInputStream input, ExtensionRegistry extensionRegistry, IBuilder builder) { MessageDescriptor type = builder.DescriptorForType; // The wire format for MessageSet is: // message MessageSet { // repeated group Item = 1 { // required int32 typeId = 2; // required bytes message = 3; // } // } // "typeId" is the extension's field number. The extension can only be // a message type, where "message" contains the encoded bytes of that // message. // // In practice, we will probably never see a MessageSet item in which // the message appears before the type ID, or where either field does not // appear exactly once. However, in theory such cases are valid, so we // should be prepared to accept them. int typeId = 0; ByteString rawBytes = null; // If we encounter "message" before "typeId" IBuilderLite subBuilder = null; FieldDescriptor field = null; uint lastTag = WireFormat.MessageSetTag.ItemStart; uint tag; string name; while (input.ReadTag(out tag, out name)) { if (tag == 0 && name != null) { if (name == "type_id") { tag = WireFormat.MessageSetTag.TypeID; } else if (name == "message") { tag = WireFormat.MessageSetTag.Message; } } if (tag == 0) { if (input.SkipField()) { continue; //can't merge unknown without field tag } break; } lastTag = tag; if (tag == WireFormat.MessageSetTag.TypeID) { typeId = 0; // Zero is not a valid type ID. if (input.ReadInt32(ref typeId) && typeId != 0) { ExtensionInfo extension = extensionRegistry[type, typeId]; if (extension != null) { field = extension.Descriptor; subBuilder = extension.DefaultInstance.WeakCreateBuilderForType(); IMessageLite originalMessage = (IMessageLite) builder[field]; if (originalMessage != null) { subBuilder.WeakMergeFrom(originalMessage); } if (rawBytes != null) { // We already encountered the message. Parse it now. // TODO(jonskeet): Check this is okay. It's subtly different from the Java, as it doesn't create an input stream from rawBytes. // In fact, why don't we just call MergeFrom(rawBytes)? And what about the extension registry? subBuilder.WeakMergeFrom(rawBytes.CreateCodedInput()); rawBytes = null; } } else { // Unknown extension number. If we already saw data, put it // in rawBytes. if (rawBytes != null) { MergeField(typeId, UnknownField.CreateBuilder().AddLengthDelimited(rawBytes).Build()); rawBytes = null; } } } } else if (tag == WireFormat.MessageSetTag.Message) { if (subBuilder != null) { // We already know the type, so we can parse directly from the input // with no copying. Hooray! input.ReadMessage(subBuilder, extensionRegistry); } else if (input.ReadBytes(ref rawBytes)) { if (typeId != 0) { // We don't know how to parse this. Ignore it. MergeField(typeId, UnknownField.CreateBuilder().AddLengthDelimited(rawBytes).Build()); } } } else { // Unknown tag. Skip it. if (!input.SkipField()) { break; // end of group } } } if (lastTag != WireFormat.MessageSetTag.ItemEnd) { throw InvalidProtocolBufferException.InvalidEndTag(); } if (subBuilder != null) { builder[field] = subBuilder.WeakBuild(); } }
// Token: 0x060008F2 RID: 2290 RVA: 0x000155E8 File Offset: 0x000137E8 public override Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { PrepareBuilder(); UnknownFieldSet.Builder builder = null; while (input.ReadTag(out uint num, out string text)) { if (num == 0U && text != null) { int num2 = Array.BinarySearch(_pushMMPAppMessageFieldNames, text, StringComparer.Ordinal); if (num2 < 0) { if (builder == null) { builder = UnknownFieldSet.CreateBuilder(UnknownFields); } ParseUnknownField(input, builder, extensionRegistry, num, text); continue; } num = _pushMMPAppMessageFieldTags[num2]; } if (num <= 18U) { if (num == 0U) { throw InvalidProtocolBufferException.InvalidTag(); } if (num == 10U) { MMPMessage.Builder builder2 = MMPMessage.CreateBuilder(); if (result.HasMessage) { builder2.MergeFrom(Message); } input.ReadMessage(builder2, extensionRegistry); Message = builder2.BuildPartial(); continue; } if (num == 18U) { input.ReadStringArray(num, text, result.appIdList_); continue; } } else { if (num == 26U) { input.ReadStringArray(num, text, result.phoneTypeList_); continue; } if (num == 34U) { input.ReadStringArray(num, text, result.provinceList_); continue; } if (num == 42U) { result.HasSeqId = input.ReadString(ref result.seqId_); continue; } } if (WireFormat.IsEndGroupTag(num)) { if (builder != null) { UnknownFields = builder.Build(); } return(this); } if (builder == null) { builder = UnknownFieldSet.CreateBuilder(UnknownFields); } ParseUnknownField(input, builder, extensionRegistry, num, text); } if (builder != null) { UnknownFields = builder.Build(); } return(this); }
public IMessageLite CallMethod(string methodName, ICodedInputStream input, ExtensionRegistry registry) { WindowsIdentity currentUser = WindowsIdentity.GetCurrent(); if (currentUser == null) { throw new ArgumentNullException(); } IClientContext ctx = RpcCallContext.Current.Client; switch (methodName) { case "ncalrpc": { Assert.AreEqual(new byte[0], ctx.ClientAddress); Assert.AreEqual(Process.GetCurrentProcess().Id, ctx.ClientPid); Assert.AreEqual(true, ctx.ClientUser.IsAuthenticated); Assert.IsTrue(ctx.ClientUser.AuthenticationType == "NTLM" || ctx.ClientUser.AuthenticationType == "Negotiate" || ctx.ClientUser.AuthenticationType == "Kerberos"); Assert.AreEqual(currentUser.Name, ctx.ClientUser.Name); Assert.AreEqual(true, ctx.IsClientLocal); Assert.AreEqual(true, ctx.IsAuthenticated); Assert.AreEqual(false, ctx.IsImpersonating); using (ctx.Impersonate()) Assert.AreEqual(true, ctx.IsImpersonating); break; } case "ncacn_ip_tcp": { Assert.AreEqual(16, ctx.ClientAddress.Length); Assert.AreEqual(true, ctx.ClientUser.IsAuthenticated); Assert.IsTrue(ctx.ClientUser.AuthenticationType == "NTLM" || ctx.ClientUser.AuthenticationType == "Negotiate" || ctx.ClientUser.AuthenticationType == "Kerberos"); Assert.AreEqual(currentUser.Name, ctx.ClientUser.Name); Assert.AreEqual(true, ctx.IsAuthenticated); Assert.AreEqual(false, ctx.IsImpersonating); using (ctx.Impersonate()) Assert.AreEqual(true, ctx.IsImpersonating); break; } case "ncacn_np": { Assert.AreEqual(new byte[0], ctx.ClientAddress); Assert.AreEqual(true, ctx.ClientUser.IsAuthenticated); Assert.IsTrue(ctx.ClientUser.AuthenticationType == "NTLM" || ctx.ClientUser.AuthenticationType == "Negotiate" || ctx.ClientUser.AuthenticationType == "Kerberos"); Assert.AreEqual(currentUser.Name, ctx.ClientUser.Name); Assert.AreEqual(true, ctx.IsAuthenticated); Assert.AreEqual(false, ctx.IsImpersonating); using (ctx.Impersonate()) Assert.AreEqual(true, ctx.IsImpersonating); break; } case "ncacn_np-Anonymous": { Assert.AreEqual(new byte[0], ctx.ClientAddress); Assert.AreEqual(false, ctx.ClientUser.IsAuthenticated); Assert.AreEqual("", ctx.ClientUser.AuthenticationType); Assert.AreEqual("", ctx.ClientUser.Name); Assert.AreEqual(false, ctx.IsAuthenticated); Assert.AreEqual(false, ctx.IsImpersonating); try { // impersonation not allowed when no credentials were provided, however, you can use ctx.ClientUser.Impersonate ctx.Impersonate(); } catch (UnauthorizedAccessException) { } Assert.AreEqual(false, ctx.IsImpersonating); break; } } return RpcVoid.DefaultInstance; }
public static SmsContentEntry ParseFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) { return(SmsContentEntry.CreateBuilder().MergeFrom(input, extensionRegistry).BuildParsed()); }