lib/zip/ioextras.rb in rubyzip-2.3.2 vs lib/zip/ioextras.rb in rubyzip-2.4.rc1
- old
+ new
@@ -4,17 +4,17 @@
RANGE_ALL = 0..-1
class << self
def copy_stream(ostream, istream)
- ostream.write(istream.read(CHUNK_SIZE, '')) until istream.eof?
+ ostream.write(istream.read(CHUNK_SIZE, ''.b)) until istream.eof?
end
def copy_stream_n(ostream, istream, nbytes)
toread = nbytes
while toread > 0 && !istream.eof?
tr = toread > CHUNK_SIZE ? CHUNK_SIZE : toread
- ostream.write(istream.read(tr, ''))
+ ostream.write(istream.read(tr, ''.b))
toread -= tr
end
end
end