java复习

2020-07-04字符缓冲流

2020-07-04  本文已影响0人  智障猿

字符缓冲流

BufferedReader bufferedReader =new BufferedReader(new FileReader("fileTest\\hello.txt"));
BufferedWriter bufferedWriter =new BufferedWriter(new FileWriter("fileTest\\hi.txt"));
char[] a = new char[1024];
int len;
while ((len = bufferedReader.read(a))!=-1){
       bufferedWriter.write(a,0,len);
}
bufferedReader.close();
bufferedWriter.close();

字符缓冲流的特有功能

上一篇下一篇

猜你喜欢

热点阅读