Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the most optimized way of writing a file

 
Biren shah
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Joe Ess
Bartender
Pie
Posts: 9264
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Biren shah
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Ess
this will really help
 
Biren shah
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Ess
this will really help
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic