Here you can find the source of WriteStringToFile(String fn, String dest)
Parameter | Description |
---|---|
fn | the fn |
dest | the dest |
public static void WriteStringToFile(String fn, String dest)
//package com.java2s; //License from project: Apache License import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class Main { /**// ww w . j a va 2s. co m * Write string to file. * * @param fn the fn * @param dest the dest */ public static void WriteStringToFile(String fn, String dest) { FileOutputStream fo = null; try { fo = new FileOutputStream(fn); fo.write(dest.getBytes()); fo.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }