Java Write String to File writeFile(String fileName, String source)

Here you can find the source of writeFile(String fileName, String source)

Description

write File

License

Open Source License

Declaration

private static void writeFile(String fileName, String source) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.FileWriter;
import java.io.IOException;

public class Main {

    private static void writeFile(String fileName, String source) throws IOException {
        FileWriter fos = new FileWriter(fileName);
        for (int i = 0; i < source.length(); i++) {
            fos.write(source.charAt(i));
        }/*from   w  w w . ja  va 2 s.co m*/
        fos.close();
        return;
    }
}

Related

  1. writeFile(String fileName, String fileContent)
  2. writeFile(String fileName, String fileData)
  3. writeFile(String fileName, String message)
  4. writeFile(String fileName, String output)
  5. writeFile(String filename, String s)
  6. writeFile(String filename, String str)
  7. writeFile(String filename, String string)
  8. writeFile(String filename, String text)
  9. writeFile(String filename, String text)