class Aws::S3::EncryptionV2::IODecrypter
@api private
def finalize
def finalize @io.write(@cipher.final) end
def initialize(cipher, io)
-
io
(IO#write
) -- An IO-like object that responds to `#write`. -
cipher
(OpenSSL::Cipher
) --
def initialize(cipher, io) @cipher = cipher # Ensure that IO is reset between retries @io = io.tap { |io| io.truncate(0) if io.respond_to?(:truncate) } @cipher_buffer = String.new end
def write(chunk)
def write(chunk) # decrypt and write if @cipher.method(:update).arity == 1 @io.write(@cipher.update(chunk)) else @io.write(@cipher.update(chunk, @cipher_buffer)) end end