Class: Higgs::Tar::RawIO
- Inherits:
-
Object
- Object
- Higgs::Tar::RawIO
- Extended by:
- Forwardable
- Defined in:
- lib/higgs/tar.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(io) ⇒ RawIO
constructor
A new instance of RawIO.
- #pos=(pos) ⇒ Object
- #read(*args) ⇒ Object
- #seek(*args) ⇒ Object
- #tell ⇒ Object (also: #pos)
- #write(*args) ⇒ Object
Constructor Details
#initialize(io) ⇒ RawIO
Returns a new instance of RawIO.
124 125 126 |
# File 'lib/higgs/tar.rb', line 124 def initialize(io) @io = io end |
Class Method Details
.open(path, *args) ⇒ Object
118 119 120 121 122 |
# File 'lib/higgs/tar.rb', line 118 def self.open(path, *args) io = File.open(path, *args) io.binmode RawIO.new(io) end |
Instance Method Details
#pos=(pos) ⇒ Object
150 151 152 |
# File 'lib/higgs/tar.rb', line 150 def pos=(pos) @io.sysseek(pos, IO::SEEK_SET) end |
#read(*args) ⇒ Object
128 129 130 131 132 133 134 |
# File 'lib/higgs/tar.rb', line 128 def read(*args) begin @io.sysread(*args) rescue EOFError nil end end |
#seek(*args) ⇒ Object
140 141 142 |
# File 'lib/higgs/tar.rb', line 140 def seek(*args) @io.sysseek(*args) end |
#tell ⇒ Object Also known as: pos
144 145 146 |
# File 'lib/higgs/tar.rb', line 144 def tell @io.sysseek(0, IO::SEEK_CUR) end |
#write(*args) ⇒ Object
136 137 138 |
# File 'lib/higgs/tar.rb', line 136 def write(*args) @io.syswrite(*args) end |