Here you can find the source of writeFile(String p_filename, String p_buffer)
Parameter | Description |
---|---|
p_filename | String |
p_buffer | String |
Parameter | Description |
---|---|
IOException | an exception |
public static void writeFile(String p_filename, String p_buffer) throws IOException
//package com.java2s; import java.io.*; public class Main { /**//from w ww . ja v a2 s . co m * Write a TEXT file * @param p_filename String * @param p_buffer String * @throws IOException */ public static void writeFile(String p_filename, String p_buffer) throws IOException { FileOutputStream os = null; try { os = new FileOutputStream(p_filename); if (p_buffer != null) { os.write(p_buffer.getBytes()); } os.close(); os = null; } finally { if (os != null) { os.close(); } } } }