コード例 #1
0
ファイル: str.py プロジェクト: hansihe/pymcprotocol
 def decode(self, field, buf):
     byte_count, str_length = varint_util.decode_varint(buf)
     buf = buf[byte_count:]
     val = buf[:str_length].decode("utf-8")
     buf = buf[str_length:]
     return buf, val
コード例 #2
0
ファイル: varint.py プロジェクト: hansihe/pymcprotocol
 def decode(self, field, buf):
     byte_count, var = varint_util.decode_varint(buf)
     buf = buf[byte_count:]
     return buf, var