I've been working on a simple client/server backup app, and I can't seem to find an answer to this anywhere. What is the normal size that people use for their buffer length? What is a good size to keep memory usage low but execute file read/writes on large files fairly quickly?
Is there a standard? I notice that most people use multiples of 1024. 2048, 4096, 8192, etc.
Here's an example of what I'm doing, this is used on both local file read/writes and network read/writes in my app. As you can see I am using 4096 at the moment.
bytesRead = strm1.Read(bBuffer, 0, 4096)
If bytesRead > 0 Then
strm2.Write(bBuffer, 0, bytesRead)
Loop While bytesRead > 0