何らかの理由で、私の String は PrintWriter によって部分的に書き込まれます。その結果、ファイルに部分的なテキストが表示されます。メソッドは次のとおりです。
public void new_file_with_text(String text, String fname) {
File f = null;
try {
f = new File(fname);
f.createNewFile();
System.out.println(text);
PrintWriter out = new PrintWriter(f, "UTF-8");
out.print(text);
} catch (IOException e) {
e.printStackTrace();
}
}
テキストをコンソールに出力すると、データはすべてそこにあり、何も失われていないことがわかりますが、PrintWriter がジョブを実行するときにテキストの一部が失われているようです...私は無知です..