Class: Rbzlib::Bytef_arr

Inherits:
Bytef_str show all
Defined in:
lib/pr/rbzlib.rb

Instance Attribute Summary

Attributes inherited from Bytef_str

#buffer, #offset

Instance Method Summary collapse

Methods inherited from Bytef_str

#+, #-, #current, #length

Constructor Details

#initialize(buffer, offset = 0) ⇒ Bytef_arr

Returns a new instance of Bytef_arr.



210
211
212
213
# File 'lib/pr/rbzlib.rb', line 210

def initialize(buffer, offset=0)
    @buffer = buffer
    @offset = offset
end

Instance Method Details

#[](idx) ⇒ Object



215
216
217
# File 'lib/pr/rbzlib.rb', line 215

def [](idx)
  @buffer[idx + @offset]
end

#[]=(idx, val) ⇒ Object



219
220
221
# File 'lib/pr/rbzlib.rb', line 219

def []=(idx, val)
  @buffer[idx + @offset] = val
end

#getObject



223
224
225
# File 'lib/pr/rbzlib.rb', line 223

def get()
  @buffer[@offset]
end

#set(val) ⇒ Object



227
228
229
# File 'lib/pr/rbzlib.rb', line 227

def set(val)
  @buffer[@offset] = val
end