예제 #1
0
 def decode_byte(buf, offset):
     return LE_INT8.unpack_from(buf, offset)[0]
예제 #2
0
 def decode_boolean(buf, offset):
     return LE_INT8.unpack_from(buf, offset)[0] == 1
예제 #3
0
 def encode_byte(buf, offset, value):
     LE_INT8.pack_into(buf, offset, value)
예제 #4
0
 def encode_boolean(buf, offset, value):
     if value:
         LE_INT8.pack_into(buf, offset, 1)
     else:
         LE_INT8.pack_into(buf, offset, 0)