import java.io.FileOutputStream; import java.io.IOException; /*换行符号: window: Linux:/n mac:/r*/ public class Demo03OutPutStream { public static void main(String[] args) throws IOException { FileOutputStream fos=new FileOutputStream("F:\basic\untitled13\src\it\cast\day15\demo01\2.txt",true);//开关是否追加 fos.write(" ".getBytes()); fos.write(97); fos.close(); } }