/** 现在不用qq了。
*/
/**
* 写出文件
* @param content
* @param fileName
* @param charsetName
*/
public void writeToFile(String content, String fileName, String charsetName) {
try {
FileInputStream a;
FileOutputStream fos = new FileOutputStream(fileName);
OutputStreamWriter osw;
if (charsetName == null) {
osw = new OutputStreamWriter(fos);// 使用系统默认编码。记事本另存为的时候,编码显示的是 ANSI ,相当于没有编码
} else {
osw = new OutputStreamWriter(fos, charsetName);
}
BufferedWriter bw = new BufferedWriter(osw);
try {
bw.write(content, 0, content.length());
} finally {
bw.close();
}
} catch (IOException e) {
Logger.getLogger(CommonSample.class.getName()).log(Level.SEVERE, null, e);
}
}