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:
parent
bb9f6b568d
commit
572dbcdbd4
3 changed files with 32 additions and 59 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue