I\'m reading binary files and here is a sample:
public static byte[] ReadFully(Stream input)
{
byte[] buffer = new byte[16*1024];
int read;
while
"Sequential File Programming Patterns and Performance with .NET" is a great article in I/O performance improvement.
In page 8 of this PDF file, it shows that the bandwidth for buffer size bigger than eight bytes, is constant. Consider that the article has been written in 2004 and the hard disk drive is "Maxtor 250 GB 7200 RPM SATA disk" and the result should be different by latest I/O technologies.
If you are looking for the best performance take a look at pinvoke.net or the page 9 of the PDF file, the un-buffered file performance measurements shows better results:
In un-buffered I/O, the disk data moves directly between the application’s address space and the device without any intermediate copying.