aspose file tools*
The moose likes Beginning Java and the fly likes Which class is suitable ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Which class is suitable ?" Watch "Which class is suitable ?" New topic
Author

Which class is suitable ?

benny rusli
Ranch Hand

Joined: Jan 15, 2005
Posts: 72
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

Joined: Mar 22, 2002
Posts: 60
I would use something like this:


<a href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank" rel="nofollow">How To Ask Smart Questions</a>
ak pillai
author
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
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 ]

java j2ee job interview questions with answers | Learn the core concepts and the key areas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Which class is suitable ?
 
Similar Threads
How much of java.io is required ?
properties file
Download Web Site's Source Code
J2SE 5.0 and NIO
Exam Topics