Sha256: d13580ee548c4d4091ad2ef38252bf7329ef05bbaab185ea3bc29aa1ef3efb2e
Contents?: true
Size: 730 Bytes
Versions: 2
Compression:
Stored size: 730 Bytes
Contents
module Zip class DecryptedIo #:nodoc:all CHUNK_SIZE = 32_768 def initialize(io, decrypter) @io = io @decrypter = decrypter end def read(length = nil, outbuf = '') return ((length.nil? || length.zero?) ? "" : nil) if eof while length.nil? || (buffer.bytesize < length) break if input_finished? buffer << produce_input end outbuf.replace(buffer.slice!(0...(length || output_buffer.bytesize))) end private def eof buffer.empty? && input_finished? end def buffer @buffer ||= ''.dup end def input_finished? @io.eof end def produce_input @decrypter.decrypt(@io.read(CHUNK_SIZE)) end end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
tdiary-5.1.1 | vendor/bundle/ruby/2.7.0/gems/rubyzip-2.2.0/lib/zip/crypto/decrypted_io.rb |
rubyzip-2.2.0 | lib/zip/crypto/decrypted_io.rb |