package com.qyl.outString;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import org.junit.Test;
public class TestOutString {
@Test
public void outString() throws Exception {
FileOutputStream file = new FileOutputStream("C:\\Users\\Administrator\\Desktop\\input.txt",true);
String str = "儒雅之风,君子之道";
file.write(str.getBytes());
file.close();
}
@Test
public void testFileWrite() throws Exception{
FileWriter w = new FileWriter("C:\\Users\\Administrator\\Desktop\\input.txt", true);
w.write("滚吧");
w.append(",去你妈的");
w.close();
}
}