Class: RBzip2::IO
- Inherits:
-
Object
- Object
- RBzip2::IO
- Defined in:
- lib/rbzip2/io.rb
Overview
This code is free software; you can redistribute it and/or modify it under the terms of the new BSD License.
Copyright © 2011-2017, Sebastian Staudt
Instance Method Summary collapse
- #close ⇒ Object
- #getc ⇒ Object
- #gets ⇒ Object
-
#initialize(io) ⇒ IO
constructor
A new instance of IO.
- #putc(int) ⇒ Object
- #puts(line) ⇒ Object
- #read ⇒ Object
- #write(data) ⇒ Object
Constructor Details
#initialize(io) ⇒ IO
Returns a new instance of IO.
8 9 10 11 12 |
# File 'lib/rbzip2/io.rb', line 8 def initialize(io) @io = io @compressor = RBzip2.default_adapter::Compressor.new io @decompressor = RBzip2.default_adapter::Decompressor.new io end |
Instance Method Details
#close ⇒ Object
14 15 16 17 |
# File 'lib/rbzip2/io.rb', line 14 def close @compressor.close @decompressor.close end |
#getc ⇒ Object
19 20 21 |
# File 'lib/rbzip2/io.rb', line 19 def getc @decompressor.getc end |
#gets ⇒ Object
23 24 25 |
# File 'lib/rbzip2/io.rb', line 23 def gets @decompressor.gets end |
#putc(int) ⇒ Object
27 28 29 |
# File 'lib/rbzip2/io.rb', line 27 def putc(int) @compressor.putc int end |
#puts(line) ⇒ Object
31 32 33 |
# File 'lib/rbzip2/io.rb', line 31 def puts(line) @compressor.puts line end |
#read ⇒ Object
35 36 37 |
# File 'lib/rbzip2/io.rb', line 35 def read @decompressor.read end |
#write(data) ⇒ Object
39 40 41 |
# File 'lib/rbzip2/io.rb', line 39 def write(data) @compressor.write data end |