class Aws::S3::Encryption::IOEncrypter

def encrypt_to_stringio(cipher, plain_text)

def encrypt_to_stringio(cipher, plain_text)
  if plain_text.empty?
    StringIO.new(cipher.final)
  else
    StringIO.new(cipher.update(plain_text) + cipher.final)
  end
end