Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which class is suitable ?

 
benny rusli
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello people,

i have a question, which class is convenient to use for writing more than 15.000.000 rows in a text file. The following classes are considered :
FileReader and FileWriter from java.io package, RandomAccessFile from java.io package ,or FileChannel from java.nio package. For example i want to write the iterated number into a text file, as the below code shown :




Any help will be appreciated.
 
Mark Van Tuyl
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would use something like this:
 
ak pillai
author
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, as mark suggested use buffering for improved performance.

if you need real scalability (i.e. you want to use multi-threading etc) go with java.nio.*.
[ March 12, 2006: Message edited by: ak pillai ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic