Yes, same idea as what I gave. Simpler coding, but would be same result: Just do it in "chunks". But 4096 is a very tiny chunk size. Not very efficient. You really should try increasing the chunk size *A LOT* to find the optimum size.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.