Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 032c08ad authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Simplify FileUtils.stringToFile().

Convert to byte[] directly instead of using heavier FileWriter.

Test: builds, boots
Bug: 34364961
Change-Id: If0c09a924cd73f2c4965ac9d206f9c060788d27c
parent f96e2242
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
@@ -334,12 +333,7 @@ public class FileUtils {
     * @throws IOException
     */
    public static void stringToFile(String filename, String string) throws IOException {
        FileWriter out = new FileWriter(filename);
        try {
            out.write(string);
        } finally {
            out.close();
        }
        bytesToFile(filename, string.getBytes(StandardCharsets.UTF_8));
    }

    /**