ReadFixed64() private method

private ReadFixed64 ( ) : ulong
return ulong
Beispiel #1
0
            public bool MergeFieldFrom(uint tag, CodedInputStream input)
            {
                int number = WireFormat.GetTagFieldNumber(tag);

                switch (WireFormat.GetTagWireType(tag))
                {
                case WireFormat.WireType.Varint:
                    GetFieldBuilder(number).AddVarint(input.ReadUInt64());
                    return(true);

                case WireFormat.WireType.Fixed64:
                    GetFieldBuilder(number).AddFixed64(input.ReadFixed64());
                    return(true);

                case WireFormat.WireType.LengthDelimited:
                    GetFieldBuilder(number).AddLengthDelimited(input.ReadBytes());
                    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);

                case WireFormat.WireType.Fixed32:
                    GetFieldBuilder(number).AddFixed32(input.ReadFixed32());
                    return(true);

                default:
                    throw InvalidProtocolBufferException.InvalidWireType();
                }
            }
 /// <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, CodedInputStream input)
 {
     int number = WireFormat.GetTagFieldNumber(tag);
     switch (WireFormat.GetTagWireType(tag)) {
       case WireFormat.WireType.Varint:
     GetFieldBuilder(number).AddVarint(input.ReadUInt64());
     return true;
       case WireFormat.WireType.Fixed64:
     GetFieldBuilder(number).AddFixed64(input.ReadFixed64());
     return true;
       case WireFormat.WireType.LengthDelimited:
     GetFieldBuilder(number).AddLengthDelimited(input.ReadBytes());
     return true;
       case WireFormat.WireType.StartGroup: {
     Builder subBuilder = CreateBuilder();
     input.ReadUnknownGroup(number, subBuilder);
     GetFieldBuilder(number).AddGroup(subBuilder.Build());
     return true;
       }
       case WireFormat.WireType.EndGroup:
     return false;
       case WireFormat.WireType.Fixed32:
     GetFieldBuilder(number).AddFixed32(input.ReadFixed32());
     return true;
       default:
     throw InvalidProtocolBufferException.InvalidWireType();
     }
 }