Buffer 16K at a time
This commit is contained in:
parent
3821c190f9
commit
120bd43f87
@ -209,7 +209,7 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy
|
|||||||
Utils.popen_read(tool, "-f", cached_location.to_s, "-c") do |pipe|
|
Utils.popen_read(tool, "-f", cached_location.to_s, "-c") do |pipe|
|
||||||
File.open(target, "wb") do |f|
|
File.open(target, "wb") do |f|
|
||||||
buf = ""
|
buf = ""
|
||||||
f.write(buf) while pipe.read(1024, buf)
|
f.write(buf) while pipe.read(16384, buf)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -262,7 +262,7 @@ class Pathname
|
|||||||
digest.file(self)
|
digest.file(self)
|
||||||
else
|
else
|
||||||
buf = ""
|
buf = ""
|
||||||
open("rb") { |f| digest << buf while f.read(1024, buf) }
|
open("rb") { |f| digest << buf while f.read(16384, buf) }
|
||||||
end
|
end
|
||||||
digest.hexdigest
|
digest.hexdigest
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user