Пример #1
0
    def is_unpackable(self, bytes, offset):
        head, offset2 = base128variant.unpack(bytes, offset)
        if ((head >> 3) == self.index):
            if ((head & 7) == self.get_wire_type()):
                return offset2

        return None
Пример #2
0
    def unpack_stream(cls, bytes, offset):
        value_len, offset = base128variant.unpack(bytes, offset)

        value = bytes[offset:offset + value_len]
        offset += value_len

        return value, offset
Пример #3
0
    def unpack(self, bytes, offset):
        value_len, offset = base128variant.unpack(bytes, offset)

        for index in range(value_len):
            value, offset = self.value_type.unpack_stream(bytes, offset)
            self.values.append(value)

        return self, offset
Пример #4
0
 def unpack_stream(cls, bytes, offset):
     ret, offset = base128variant.unpack(bytes, offset)
     return ret, offset
Пример #5
0
 def unpack_stream(cls, bytes, offset):
     ret, offset = base128variant.unpack(bytes, offset)
     return zigzag.decode(ret), offset