'Resets the output files. Must be called once before Write().'

def ResetFiles(self):

    if self._ref_file:
        self._ref_file.close()
    if self._decode_file:
        self._decode_file.close()
    timestamp = int(time.time())
    self._ref_file = open(os.path.join(self._outdir, ('ref%d' % timestamp)), 'w')
    self._decode_file = open(os.path.join(self._outdir, ('decode%d' % timestamp)), 'w')
