I have a batch process that writes an output of 155 MB file to disk. When I observed the progress, it looks like it takes 10 minutes to write first 10 MB, about 20 minutes for the next 10 MB and so on. I used
Writer out = new PrintWriter(new BufferedWriter(new File Writer(fileName)), true);//true for auto flush
out.write(
String);
Is this the most efficient way of writing or is it better to split the output to different files and merge all the files at the end? Are there more efficient ways of writing to file? I need suggestions.
Thanks