コード例 #1
0
        public UInt64 PBReadFieldInfo(out UInt64 aTag, out TWireType aWireType)
        {
            UInt64 ui64;
            UInt64 res = PBRead(out ui64);

            aWireType = (TWireType)(ui64 & 7);
            aTag      = ui64 >> 3;
            return(res);
        }
コード例 #2
0
        // PB skip a specific wire type
        public UInt64 PBSkip(TWireType aWireType)
        {
            UInt64 varInt;
            UInt64 res = 0;

            switch (aWireType)
            {
            case TWireType.wtVarInt:
                res = PBRead(out varInt);
                break;

            case TWireType.wt64Bit:
                res = 8;
                SkipReading((int)res);
                break;

            case TWireType.wtLengthDelimited:
                res = PBRead(out varInt);
                res = res + varInt;
                SkipReading((int)varInt);
                break;

            case TWireType.wtStartGroup:
                throw new Exception("'Start group' wire type is not supported");

            case TWireType.wtEndGroup:
                throw new Exception("'End group' wire type is not supported");

            case TWireType.wt32Bit:
                res = 4;
                SkipReading((int)res);
                break;

            default:
                res = 0;
                break;
            }
            return(res);
        }
コード例 #3
0
ファイル: ByteBuffers.cs プロジェクト: TNOCS/csTouch
 public UInt64 PBQWriteFieldInfo(UInt64 aTag, TWireType aWiretype)
 {
     return PBQWrite((UInt64)((aTag << 3) | (UInt32)aWiretype));
 }
コード例 #4
0
ファイル: ByteBuffers.cs プロジェクト: TNOCS/csTouch
 public UInt64 PBPrepareFieldInfo(UInt64 aTag, TWireType aWireType)
 {
     return PBPrepare((UInt64)((aTag << 3) | (UInt32)aWireType));
 }
コード例 #5
0
ファイル: ByteBuffers.cs プロジェクト: TNOCS/csTouch
 // PB skip a specific wire type
 public UInt64 PBSkip(TWireType aWireType)
 {
     UInt64 varInt;
     UInt64 res = 0;
     switch (aWireType)
     {
         case TWireType.wtVarInt:
             res = PBRead(out varInt);
             break;
         case TWireType.wt64Bit:
             res = 8;
             SkipReading((int)res);
             break;
         case TWireType.wtLengthDelimited:
             res = PBRead(out varInt);
             res = res + varInt;
             SkipReading((int)varInt);
             break;
         case TWireType.wtStartGroup:
             throw new Exception("'Start group' wire type is not supported");
         case TWireType.wtEndGroup:
             throw new Exception("'End group' wire type is not supported");
         case TWireType.wt32Bit:
             res = 4;
             SkipReading((int)res);
             break;
         default:
             res = 0;
             break;
     }
     return res;
 }
コード例 #6
0
ファイル: ByteBuffers.cs プロジェクト: TNOCS/csTouch
 public UInt64 PBReadFieldInfo(out UInt64 aTag, out TWireType aWireType)
 {
     UInt64 ui64;
     UInt64 res = PBRead(out ui64);
     aWireType = (TWireType)(ui64 & 7);
     aTag = ui64 >> 3;
     return res;
 }
コード例 #7
0
 public UInt64 PBQWriteFieldInfo(UInt64 aTag, TWireType aWiretype)
 {
     return(PBQWrite((UInt64)((aTag << 3) | (UInt32)aWiretype)));
 }
コード例 #8
0
 public UInt64 PBPrepareFieldInfo(UInt64 aTag, TWireType aWireType)
 {
     return(PBPrepare((UInt64)((aTag << 3) | (UInt32)aWireType)));
 }