H
hristo
I have some questions regarding the I/O file operations efficiency.
Consider I/O operations involving the disk. Assume that I write
periodically one Byte in the file after executing one processing block
of code. Does this mean that at each of these periods, that only Byte
will be stored in the disk despite its slow access time, or instead it
will be stored in the memory buffer (of what size?) first then moved
into the disk once the buffer is full?
Should the programmer force the second option (by using
BufferOutputStream) or is it done automatically by the JVM or OS?
I have read also that writing and reading should be done on chunks of
256 (512,1024) bytes since the disk sector is of this size. Should I
specify explicitly the buffer size or will it be handled automatically
by the JVM or OS
Say I have a stream of X bytes, should write it into the disk per
once, or instead repetitively on X/256 bytes size.
Thanks for your help
Consider I/O operations involving the disk. Assume that I write
periodically one Byte in the file after executing one processing block
of code. Does this mean that at each of these periods, that only Byte
will be stored in the disk despite its slow access time, or instead it
will be stored in the memory buffer (of what size?) first then moved
into the disk once the buffer is full?
Should the programmer force the second option (by using
BufferOutputStream) or is it done automatically by the JVM or OS?
I have read also that writing and reading should be done on chunks of
256 (512,1024) bytes since the disk sector is of this size. Should I
specify explicitly the buffer size or will it be handled automatically
by the JVM or OS
Say I have a stream of X bytes, should write it into the disk per
once, or instead repetitively on X/256 bytes size.
Thanks for your help