def handleStreamEnd(self):
        self.header.prop.num_packets = self.num_packets
        self.header.data.num_packets = self.num_packets
        self.header.data.size += self.data_size
        if self.out_file:
            self.out_file.seek(0)
            self.out_file.write(self.header.dump())
            self.out_file.close()
        self.factory.success(0)