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
> 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