title: Automatically selecting buffer size for File I/O
body: <p>I have a pretty basic doubt. Often, I have to write apps which use buffered file I/O and every time I am faced with the dilemma of choosing the buffer size and I end up doing trial and error often with pretty nasty results. I want to know if there is any method or algorithm which can automatically determine the optimum buffer size for the job based on the underlying platform like Teracopy does when handling files in Windows. I mainly use Qt for the GUI.</p>
  
  <p>If possible a tiny example in C/C++/C#/Java is very much appreciated!</p>
  
  <p>Thanks!</p>