modify func source code: add bufsize option, change default bufsize to 10M