bufferedreader - A Little complicated Java case - What is the fastest way to write calculations data onto a file -
i using bufferedreader (br) , bufferedwriter (bw) read large file, calculations, , write results on output file. output file have same number of lines in input file.
what doing getting data input file line line (while br.readline() != null), calculations of line read, write result of single calculation onto output file (br.write) write new line (bw.newline()). loop repeats until reaches end of file.
this works not bad.. takes me 1 second process 3500 input lines. have been told 2 code tested larger files. best practice should use (both read , write)? can keep results chunks in buffer until specific limit write actual file?
edit: think reading/performing calculation part good, how writing keeping parts in buffer writing output file? there way avoid writing every iteration?
Comments
Post a Comment