package com.reactlibrary.updatebundle;

import java.io.File;
import java.io.FileOutputStream;

/**
 * 字符串转成file文件
 * Created by MJX on 2017/4/12.
 */
public class StrToFileUtil {
    /**
     * 把字符串转化到对应的文件中
     * @param toSaveString
     * @param saveFile
     */
    public static void saveStrToFile(String toSaveString,File saveFile){
        FileOutputStream outStream = null;
        try {
            if(!saveFile.exists()){
                saveFile.createNewFile();
            }
            outStream = new FileOutputStream(saveFile);
            outStream.write(toSaveString.getBytes());
            outStream.close();
        } catch (Exception e) {
//            isException = true;
            e.printStackTrace();
        }

    }
}
