Class: Zip::Bzip2::Decompressor
- Inherits:
-
Decompressor
- Object
- Decompressor
- Zip::Bzip2::Decompressor
- Defined in:
- lib/zip/bzip2/decompressor.rb
Overview
:nodoc:
Instance Method Summary collapse
- #eof ⇒ Object (also: #eof?)
-
#initialize(*args) ⇒ Decompressor
constructor
A new instance of Decompressor.
- #read(length = nil, outbuf = +'')) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Decompressor
Returns a new instance of Decompressor.
8 9 10 11 12 13 |
# File 'lib/zip/bzip2/decompressor.rb', line 8 def initialize(*args) super @buffer = +'' @bzip2_ffi_decompressor = ::Zip::Bzip2::Decompress.new end |
Instance Method Details
#eof ⇒ Object Also known as: eof?
23 24 25 |
# File 'lib/zip/bzip2/decompressor.rb', line 23 def eof @buffer.empty? && input_finished? end |
#read(length = nil, outbuf = +'')) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/zip/bzip2/decompressor.rb', line 15 def read(length = nil, outbuf = +'') return return_value_on_eof(length) if eof fill_buffer(length) outbuf.replace(@buffer.slice!(0...(length || @buffer.bytesize))) end |