This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes what is the most optimized way of writing a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "what is the most optimized way of writing a file" Watch "what is the most optimized way of writing a file" New topic
Author

what is the most optimized way of writing a file

Biren shah
Ranch Hand

Joined: Apr 13, 2005
Posts: 107
hi friends,
i do write a file..and some times read them also.
i want a tutorial or way of writing the file in most optimized way


Biren Shah<br />scjp 93%<br />scwcd 1.4 92%
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

Java Platform Performance has a chapter on IO. Be aware that there is no one answer to your question. It depends on a large number of factors.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Biren shah
Ranch Hand

Joined: Apr 13, 2005
Posts: 107
thanks Ess
this will really help
Biren shah
Ranch Hand

Joined: Apr 13, 2005
Posts: 107
thanks Ess
this will really help
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
I believe the faster way to access a file (read/write) is using the java.nio.MappedByteBuffer obtained from a FileChannel.

For instance:



It is the most direct way to access the file and therefore should be the faster.
 
 
subject: what is the most optimized way of writing a file
 
Similar Threads
Help me solve a puzzle on datastructures
Export data from database
Text file parsing
Optimizing HSQLDB
Client Side ORM tool ?