From bbabbbcbdddea36a5af451208a82de806e66f2d4 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Mon, 4 Mar 2024 10:11:20 +0700 Subject: [PATCH] save --- metainfo/info.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metainfo/info.go b/metainfo/info.go index 5eedfa3b4c..bc7f8b3fb5 100644 --- a/metainfo/info.go +++ b/metainfo/info.go @@ -1,6 +1,7 @@ package metainfo import ( + "bufio" "errors" "fmt" "io" @@ -98,7 +99,7 @@ func (info *Info) writeFiles(w io.Writer, open func(fi FileInfo) (io.ReadCloser, if err != nil { return fmt.Errorf("error opening %v: %s", fi, err) } - wn, err := io.CopyN(w, r, fi.Length) + wn, err := io.CopyN(w, bufio.NewReaderSize(r, 4*1024*1024), fi.Length) r.Close() if wn != fi.Length { return fmt.Errorf("error copying %v: %s", fi, err)