Class: Omnizip::Implementations::Base::LZMADecoderBase Abstract
- Inherits:
-
Object
- Object
- Omnizip::Implementations::Base::LZMADecoderBase
- Defined in:
- lib/omnizip/implementations/base/lzma_decoder_base.rb
Overview
Subclasses must implement #decode_stream
Abstract base class for LZMA decoders.
This class defines the common interface and shared functionality for all LZMA decoder implementations (XZ Utils, 7-Zip SDK, etc.).
Subclasses must implement the #decode_stream method.
Instance Attribute Summary collapse
-
#dict_size ⇒ Object
readonly
Returns the value of attribute dict_size.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#lc ⇒ Object
readonly
Returns the value of attribute lc.
-
#lp ⇒ Object
readonly
Returns the value of attribute lp.
-
#pb ⇒ Object
readonly
Returns the value of attribute pb.
-
#uncompressed_size ⇒ Object
readonly
Returns the value of attribute uncompressed_size.
Instance Method Summary collapse
-
#decode_stream(output = nil) ⇒ void
Decode a stream of compressed data.
-
#implementation_name ⇒ Symbol
Get the implementation identifier.
-
#initialize(input, options = {}) ⇒ LZMADecoderBase
constructor
Initialize the LZMA decoder.
Constructor Details
#initialize(input, options = {}) ⇒ LZMADecoderBase
Initialize the LZMA decoder.
46 47 48 49 50 51 52 53 54 |
# File 'lib/omnizip/implementations/base/lzma_decoder_base.rb', line 46 def initialize(input, = {}) @input = input # Parameters will be read from LZMA header by subclasses @lc = .fetch(:lc, nil) @lp = .fetch(:lp, nil) @pb = .fetch(:pb, nil) @dict_size = .fetch(:dict_size, nil) @uncompressed_size = .fetch(:uncompressed_size, nil) end |
Instance Attribute Details
#dict_size ⇒ Object (readonly)
Returns the value of attribute dict_size.
35 36 37 |
# File 'lib/omnizip/implementations/base/lzma_decoder_base.rb', line 35 def dict_size @dict_size end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
35 36 37 |
# File 'lib/omnizip/implementations/base/lzma_decoder_base.rb', line 35 def input @input end |
#lc ⇒ Object (readonly)
Returns the value of attribute lc.
35 36 37 |
# File 'lib/omnizip/implementations/base/lzma_decoder_base.rb', line 35 def lc @lc end |
#lp ⇒ Object (readonly)
Returns the value of attribute lp.
35 36 37 |
# File 'lib/omnizip/implementations/base/lzma_decoder_base.rb', line 35 def lp @lp end |
#pb ⇒ Object (readonly)
Returns the value of attribute pb.
35 36 37 |
# File 'lib/omnizip/implementations/base/lzma_decoder_base.rb', line 35 def pb @pb end |
#uncompressed_size ⇒ Object (readonly)
Returns the value of attribute uncompressed_size.
35 36 37 |
# File 'lib/omnizip/implementations/base/lzma_decoder_base.rb', line 35 def uncompressed_size @uncompressed_size end |
Instance Method Details
#decode_stream(output = nil) ⇒ void
This method returns an undefined value.
Decode a stream of compressed data.
Subclasses must implement this method to provide the specific decoding logic for their implementation (XZ Utils, 7-Zip, etc.).
64 65 66 67 |
# File 'lib/omnizip/implementations/base/lzma_decoder_base.rb', line 64 def decode_stream(output = nil) raise NotImplementedError, "#{self.class} must implement #decode_stream" end |
#implementation_name ⇒ Symbol
Get the implementation identifier.
Subclasses must implement this to return a symbol identifying their implementation (e.g., :xz_utils, :seven_zip).
76 77 78 79 |
# File 'lib/omnizip/implementations/base/lzma_decoder_base.rb', line 76 def implementation_name raise NotImplementedError, "#{self.class} must implement #implementation_name" end |