Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within I/O and Streams
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
I/O and Streams
what is the most optimized way of writing a file
Biren shah
Ranch Hand
Posts: 107
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 9626
16
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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.
[
How To Ask Questions On JavaRanch
]
Biren shah
Ranch Hand
Posts: 107
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
thanks Ess
this will really help
Biren Shah<br />scjp 93%<br />scwcd 1.4 92%
Biren shah
Ranch Hand
Posts: 107
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
thanks Ess
this will really help
Biren Shah<br />scjp 93%<br />scwcd 1.4 92%
Edwin Dalorzo
Ranch Hand
Posts: 961
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I believe the faster way to access a file (read/write) is using the java.nio.MappedByteBuffer obtained from a FileChannel.
For instance:
RandomAccessFile in = new RandomAccessFile(deletableFile,"rw"); FileChannel fc = in.getChannel(); MappedByteBuffer bf = fc.map(MapMode.READ_WRITE, 0, fc.size());
It is the most direct way to access the file and therefore should be the faster.
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Text file parsing
Export data from database
Optimizing HSQLDB
Client Side ORM tool ?
Help me solve a puzzle on datastructures
More...