Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

Does java.nio.FileChannel automatically buffer writes?

Thread view: 
robertjparks@gmail.com - 16 May 2006 15:25 GMT
Hi, I am using java.nio.FileChannel to write out very large files. Each
call to channel.write() only writes a few  bytes at a time. Will my
program run faster if I build up a large ByteBuffer before calling
channel.write() or do FileChannels automatically buffer for you?

Thanks for your help!
Rob
Andrey Kuznetsov - 16 May 2006 16:25 GMT
> Hi, I am using java.nio.FileChannel to write out very large files. Each
> call to channel.write() only writes a few  bytes at a time. Will my
> program run faster if I build up a large ByteBuffer before calling
> channel.write() or do FileChannels automatically buffer for you?

no auto buffering.
You have to use your own buffer.
Say from 50 till 512 KB is ok.
Unified I/O could make buffering for you, however it does not work with
Channels.

Andrey

Signature

http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities

Andrey Kuznetsov - 16 May 2006 16:27 GMT
>> Hi, I am using java.nio.FileChannel to write out very large files. Each
>> call to channel.write() only writes a few  bytes at a time. Will my
[quoted text clipped - 6 lines]
> Unified I/O could make buffering for you, however it does not work with
> Channels.

see also http://uio.imagero.com/performance.html

Andrey

Signature

http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.