Class: LZ4::BasicStream::BlockHeader
- Inherits:
-
Struct
- Object
- Struct
- LZ4::BasicStream::BlockHeader
- Defined in:
- lib/extlz4/oldstream.rb,
lib/extlz4/oldstream.rb
Instance Attribute Summary collapse
-
#iscompress ⇒ Object
(also: #compress?)
Returns the value of attribute iscompress.
-
#packedsize ⇒ Object
Returns the value of attribute packedsize.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#iscompress ⇒ Object Also known as: compress?
Returns the value of attribute iscompress
188 189 190 |
# File 'lib/extlz4/oldstream.rb', line 188 def iscompress @iscompress end |
#packedsize ⇒ Object
Returns the value of attribute packedsize
188 189 190 |
# File 'lib/extlz4/oldstream.rb', line 188 def packedsize @packedsize end |
Class Method Details
.load(io) ⇒ Object
211 212 213 |
# File 'lib/extlz4/oldstream.rb', line 211 def self.load(io) unpack io.read(4) end |
.pack(iscompress, packedsize) ⇒ Object
201 202 203 |
# File 'lib/extlz4/oldstream.rb', line 201 def self.pack(iscompress, packedsize) new(iscompress, packedsize).pack end |
.unpack(data) ⇒ Object
205 206 207 208 209 |
# File 'lib/extlz4/oldstream.rb', line 205 def self.unpack(data) d = data.unpack("V")[0] new((d & LITERAL_DATA_BLOCK_FLAG) == 0 ? true : false, packedsize & ~LITERAL_DATA_BLOCK_FLAG) end |
Instance Method Details
#pack ⇒ Object
197 198 199 |
# File 'lib/extlz4/oldstream.rb', line 197 def pack [(compress? ? 0 : LITERAL_DATA_BLOCK_FLAG) | packedsize].pack("V") end |