class IOStreams::SymmetricEncryption::Writer

Public Class Methods

file(file_name, compress: nil, **args, &block) click to toggle source

Write to stream using Symmetric Encryption By default the output stream is compressed unless the file_name extension indicates the file is already compressed.

# File lib/io_streams/symmetric_encryption/writer.rb, line 15
def self.file(file_name, compress: nil, **args, &block)
  Utils.load_soft_dependency("symmetric-encryption", ".enc streaming") unless defined?(SymmetricEncryption)

  ::SymmetricEncryption::Writer.open(file_name, compress: compress, **args, &block)
end
stream(input_stream, compress: true, **args, &block) click to toggle source

Write to stream using Symmetric Encryption By default the output stream is compressed. If the input_stream is already compressed consider setting compress: false.

# File lib/io_streams/symmetric_encryption/writer.rb, line 7
def self.stream(input_stream, compress: true, **args, &block)
  Utils.load_soft_dependency("symmetric-encryption", ".enc streaming") unless defined?(SymmetricEncryption)

  ::SymmetricEncryption::Writer.open(input_stream, compress: compress, **args, &block)
end