请问为什么我的输出文件末尾会出现字符 "ÿ"?(我使用try/catch)
File f1 = new File("C:/Users/NetBeansProjects/QuestionOne/input.txt");
File f2 = new File("C:/Users/NetBeansProjects/QuestionOne/output.txt");
fin = new FileInputStream(f1);
fout = new FileOutputStream(f2);
do {
i = fin.read();
fout.write(i);
} while (i != -1);
代码复制了文件内容,但以奇怪的字符结尾。 我需要把整个代码都包含进去吗?
谢谢。