This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which class is suitable ?

 
benny rusli
Ranch Hand
Posts: 72
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would use something like this:
 
ak pillai
author
Ranch Hand
Posts: 288
  • 0
  • 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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic