Use copy file range from sysx

Use pooled buffers for copy

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Derek McGowan 2017-02-02 10:28:25 -08:00
parent bb9f6b568d
commit 572dbcdbd4
3 changed files with 32 additions and 59 deletions

View file

@ -18,7 +18,9 @@ func copyFileInfo(fi os.FileInfo, name string) error {
}
func copyFileContent(dst, src *os.File) error {
_, err := io.Copy(dst, src)
buf := bufferPool.Get().([]byte)
_, err := io.CopyBuffer(dst, src, buf)
bufferPool.Put(buf)
return err
}