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); }
// 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); }
public UInt64 PBQWriteFieldInfo(UInt64 aTag, TWireType aWiretype) { return PBQWrite((UInt64)((aTag << 3) | (UInt32)aWiretype)); }
public UInt64 PBPrepareFieldInfo(UInt64 aTag, TWireType aWireType) { return PBPrepare((UInt64)((aTag << 3) | (UInt32)aWireType)); }
// 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; }
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; }
public UInt64 PBQWriteFieldInfo(UInt64 aTag, TWireType aWiretype) { return(PBQWrite((UInt64)((aTag << 3) | (UInt32)aWiretype))); }
public UInt64 PBPrepareFieldInfo(UInt64 aTag, TWireType aWireType) { return(PBPrepare((UInt64)((aTag << 3) | (UInt32)aWireType))); }