コード例 #1
0
ファイル: encoder.py プロジェクト: bashia/Holdem
 def AppendSInt64(self, field_number, value):
     """Appends a 64-bit integer to our buffer, zigzag-encoded and then
 varint-encoded.
 """
     self._AppendTag(field_number, wire_format.WIRETYPE_VARINT)
     zigzag_value = wire_format.ZigZagEncode(value)
     self._stream.AppendVarUInt64(zigzag_value)
コード例 #2
0
ファイル: varint.py プロジェクト: xiongyihui/blackboxprotobuf
def encode_svarint(value):
    """Zigzag encode the potentially signed value prior to encoding"""
    # zigzag encode value
    return encode_uvarint(wire_format.ZigZagEncode(value))
コード例 #3
0
ファイル: encoder.py プロジェクト: key50/My_kRPC
 def _encode_signed_varint(cls, value):
     value = protobuf_wire_format.ZigZagEncode(value)
     data = []
     _SignedVarintEncoder(data.append, value)
     return b''.join(data)
コード例 #4
0
 def AppendSInt64NoTag(self, value):
     """Appends a 64-bit integer to our buffer, zigzag-encoded and then
 varint-encoded.
 """
     zigzag_value = wire_format.ZigZagEncode(value)
     self._stream.AppendVarUInt64(zigzag_value)
コード例 #5
0
 def write_long_no_tag(self, val):
     _EncodeVarint(self._write, wire_format.ZigZagEncode(val))