We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61c4f6e commit 4edc533Copy full SHA for 4edc533
src/zlib_ng/gzip_ng.py
@@ -22,6 +22,7 @@
22
import gzip
23
import io
24
import os
25
+import shutil
26
import struct
27
import sys
28
import time
@@ -302,11 +303,7 @@ def main():
302
303
global READ_BUFFER_SIZE
304
READ_BUFFER_SIZE = args.buffer_size
305
try:
- while True:
306
- block = in_file.read(args.buffer_size)
307
- if block == b"":
308
- break
309
- out_file.write(block)
+ shutil.copyfileobj(in_file, out_file, args.buffer_size)
310
finally:
311
if in_file is not sys.stdin.buffer:
312
in_file.close()
0 commit comments