def METHOD_NAME(self, fileName, data):
    if isinstance(data, bytes):
        with open(self.GetTmpFilePath(fileName), 'wb') as f:
            f.write(data)
    else:
        with codecs.open(self.GetTmpFilePath(fileName), 'w', encoding='utf-8') as f:
            f.write(data)