Java FileOutputStream Create writeFile(String f, String s)

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

Description

write File

License

Open Source License

Declaration

public static void writeFile(String f, String s) throws IOException 

Method Source Code

//package com.java2s;
// copyright 2009 ActiveVideo; license: MIT; see license.txt

import java.io.*;

public class Main {
    public static void writeFile(String f, String s) throws IOException {
        OutputStreamWriter out = null;
        try {/*ww  w  .  ja  v a  2 s. co m*/
            out = new OutputStreamWriter(new FileOutputStream(f), "UTF-8");
            out.write(s);
        } finally {
            try {
                if (out != null)
                    out.close();
            } catch (Exception ex) {
            }
        }
    }
}

Related

  1. writeFile(InputStream is, File outFile)
  2. writeFile(InputStream srcStream, File destFile)
  3. writeFile(InputStream stream, File to)
  4. writeFile(List data, String filename)
  5. writeFile(String directoryPath, String filename, byte[] bytes)
  6. writeFile(String file, byte[]... data)
  7. writeFile(String file, byte[]... data)
  8. writeFile(String fileName)
  9. writeFile(String fileOutput, byte[] data)