📄 testbufferedstreams.java
字号:
import java.io.*;
public class TestBufferedStreams {
public static void main(String[] args) {
try {
FileReader input = new FileReader(args[0]);
BufferedReader bufInput = new BufferedReader(input);
FileWriter output = new FileWriter(args[1]);
BufferedWriter bufOutput = new BufferedWriter(output);
String line;
// read the first line
line = bufInput.readLine();
while ( line != null ) {
// write the line out to the output file
bufOutput.write(line, 0, line.length());
bufOutput.newLine();//写个换行符
// read the next line
line = bufInput.readLine();
}
bufInput.close();
bufOutput.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -