Class: Omnizip::Algorithms::LZMA2::ChunkManager::Chunk
- Inherits:
-
Object
- Object
- Omnizip::Algorithms::LZMA2::ChunkManager::Chunk
- Defined in:
- lib/omnizip/algorithms/lzma2/chunk_manager.rb
Overview
Chunk data model
Represents a single chunk of data with its metadata
Instance Attribute Summary collapse
-
#compressed_data ⇒ Object
Returns the value of attribute compressed_data.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#is_compressed ⇒ Object
readonly
Returns the value of attribute is_compressed.
Instance Method Summary collapse
-
#initialize(data) ⇒ Chunk
constructor
Initialize a chunk.
-
#output_data ⇒ String
Get the data to write (compressed or uncompressed).
-
#output_size ⇒ Integer
Get size of output data.
-
#uncompressed_size ⇒ Integer
Get uncompressed size.
Constructor Details
#initialize(data) ⇒ Chunk
Initialize a chunk
56 57 58 59 60 |
# File 'lib/omnizip/algorithms/lzma2/chunk_manager.rb', line 56 def initialize(data) @data = data @compressed_data = nil @is_compressed = false end |
Instance Attribute Details
#compressed_data ⇒ Object
Returns the value of attribute compressed_data.
51 52 53 |
# File 'lib/omnizip/algorithms/lzma2/chunk_manager.rb', line 51 def compressed_data @compressed_data end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
51 52 53 |
# File 'lib/omnizip/algorithms/lzma2/chunk_manager.rb', line 51 def data @data end |
#is_compressed ⇒ Object (readonly)
Returns the value of attribute is_compressed.
51 52 53 |
# File 'lib/omnizip/algorithms/lzma2/chunk_manager.rb', line 51 def is_compressed @is_compressed end |
Instance Method Details
#output_data ⇒ String
Get the data to write (compressed or uncompressed)
74 75 76 |
# File 'lib/omnizip/algorithms/lzma2/chunk_manager.rb', line 74 def output_data @is_compressed ? @compressed_data : @data end |
#output_size ⇒ Integer
Get size of output data
81 82 83 |
# File 'lib/omnizip/algorithms/lzma2/chunk_manager.rb', line 81 def output_size output_data.bytesize end |
#uncompressed_size ⇒ Integer
Get uncompressed size
88 89 90 |
# File 'lib/omnizip/algorithms/lzma2/chunk_manager.rb', line 88 def uncompressed_size @data.bytesize end |