1. When extracting feature information from a large number of files (already written) and writing it to a txt target file, it is found that the first 1000 files are written faster and slower later. What is the problem?
2. The writing method I use
public static void writeText(File file, String content) {
BufferedWriter writer = null;
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true), "UTF-8"));
writer.append(content);
writer.newLine();
writer.flush();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}