Class: BinaryPList::Parser::OffsetTable

Inherits:
Object
  • Object
show all
Defined in:
lib/binary_plist/parser/offset_table.rb

Instance Method Summary collapse

Constructor Details

#initialize(io, offset, int_size) ⇒ OffsetTable

Returns a new instance of OffsetTable.



8
9
10
11
12
13
14
15
16
17
# File 'lib/binary_plist/parser/offset_table.rb', line 8

def initialize(io, offset, int_size)
  @io = io
  @int_size = int_size
  @offset = offset

  pos = io.tell
  io.seek(-32, File::SEEK_END)
  @last_int_loc = io.tell - @int_size
  io.seek(pos)
end

Instance Method Details

#object_offset(num) ⇒ Object



19
20
21
22
# File 'lib/binary_plist/parser/offset_table.rb', line 19

def object_offset(num)
  seek(object_offset_location(num))
  read_arbitrary_int(int_size)
end