得出结论
1:当字符串中含有'/n'时会刷新out,此处的out是OutStream对象的实例。println(String s)最后调用newLine() 方法,newLine()方法带有flush()函数,而且还会刷新testOut和charOut函数,而write()函数需要程序员手动进行刷新。
2:System.out.write读取int型会转换成相对应的ACII码,与System.in.read相对应
实例:
while ((data=System.in.read())!= -1)
//System.in.read() 读入的是char型,转成int型,每次只读一个
{
System.out.write(data);
}