def pickleIndexItem(self): import io result = io.BytesIO() from picklestream import PickleStream stream = PickleStream(result) stream.writeObject(self.encodedIndexItem) self.pickledIndexItem = result.getvalue()
def loadIndex(stream): from picklestream import PickleStream stream = PickleStream(stream) result = [] while True: try: result.append(stream.readObject()) except EOFError: break return result