1)将文件读入内存:
将BufferedInputStream与FileInputStream相接
FileInputStream in=new FileInputStream( “file1.txt ” );
BufferedInputStream bin=new BufferedInputStream( in);
2)将内存写入文件:
将BufferedOutputStream与 FileOutputStream相接
FileOutputStreamout = new FileOutputStream(“file1.txt”);
BufferedOutputStream bin = new BufferedInputStream(out);
3)键盘输入流读到内存
将BufferedReader与标准的数据流相接
InputStreamReader sin = new InputStreamReader (System.in) ;
BufferedReader bin = new BufferedReader(sin);