I've looked at io.Copy code, and realized that the buffer used is
always 32KB (it is hard coded). I think this should be some kind of
parameter, since at least in my case, I'm always using 16KB blocks.
Regards, Roger.
If the default behavior of io.Copy is not correct for
your particular reader or writer, you have three options:
1. Don't use it. It's a tiny amount of convenience code
and perfectly fine to duplicate if you really need to.
2. Implement the ReadFrom method on your Writer.
3. Implement the WriteTo method on your Reader.
Adding a block size parameter is unnecessary
complexity.
Russ
Sometimes, though, the trivia matter. It might make sense to have a Copy variant that takes a buffer size, and have Copy just call ThatCopy(32K). Then there's no code duplication and I can continue not to care about my buffer size. You can care all you want, just stay out of my parameter lists.
-rob