public static void main(String[] args) throws IOException {
try(
Reader rd = new FileReader("F:\JavaProject\Project\src\app.txt")
){
char[] reader = new char[1024]
int len
while ((len = rd.read(reader)) != -1){
String sr = new String(reader,0,len)
System.out.println(sr)
}
}catch (Exception e){
e.printStackTrace()
}
Writer wt = new FileWriter("F:\JavaProject\Project\src\app.txt",true)
wt.write('a')
wt.write("我是中国人")
wt.write("我是中国人",0,3)
char[] chars = "我爱你中国".toCharArray()
wt.write(chars)
wt.write(chars,0,3)
// wt.flush()
wt.close()
}