Class Archive::Zip::Codec::TraditionalEncryption::Encrypt
In: lib/archive/zip/codec/traditional_encryption.rb
Parent: Base

Archive::Zip::Codec::TraditionalEncryption::Encrypt is a writable, IO-like object which encrypts data written to it using the traditional encryption algorithm as documented in the ZIP specification and writes the result to a delegate IO object. A close method is also provided which can optionally close the delegate object.

Instances of this class should only be accessed via the Archive::Zip::Codec::TraditionalEncryption#compressor method.

Methods

close   new   open  

Included Modules

IO::Like

Public Class methods

Creates a new instance of this class using io as a data sink. io must be writable and must provide a write method as IO does or errors will be raised when performing write operations. password should be the encryption key. mtime must be the last modified time of the entry to be encrypted/decrypted.

The flush_size attribute is set to 0 by default under the assumption that io is already buffered.

Creates a new instance of this class with the given argument using new and then passes the instance to the given block. The close method is guaranteed to be called after the block completes.

Equivalent to new if no block is given.

Public Instance methods

Closes the stream after flushing the encryption buffer to the delegate. If close_delegate is true, the delegate object used as a data sink will also be closed using its close method.

Raises IOError if called more than once.

[Validate]