123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #region Copyright notice and license
- #endregion
- namespace Google.Protobuf
- {
-
-
-
-
-
-
-
-
-
- public static class WireFormat
- {
-
-
-
- public enum WireType : uint
- {
-
-
-
- Varint = 0,
-
-
-
- Fixed64 = 1,
-
-
-
- LengthDelimited = 2,
-
-
-
- StartGroup = 3,
-
-
-
- EndGroup = 4,
-
-
-
- Fixed32 = 5
- }
-
- private const int TagTypeBits = 3;
- private const uint TagTypeMask = (1 << TagTypeBits) - 1;
-
-
-
- public static WireType GetTagWireType(uint tag)
- {
- return (WireType) (tag & TagTypeMask);
- }
-
-
-
- public static int GetTagFieldNumber(uint tag)
- {
- return (int) tag >> TagTypeBits;
- }
-
-
-
- public static uint MakeTag(int fieldNumber, WireType wireType)
- {
- return (uint) (fieldNumber << TagTypeBits) | (uint) wireType;
- }
- }
- }
|