class Android::Resource::Chunk

Public Class Methods

new(data, offset) click to toggle source
# File lib/android/resource.rb, line 10
def initialize(data, offset)
  @data = data
  @offset = offset
  exec_parse
end

Public Instance Methods

current_position() click to toggle source
# File lib/android/resource.rb, line 30
def current_position
  @data_io.pos
end
exec_parse() click to toggle source
# File lib/android/resource.rb, line 15
def exec_parse
  @data_io = StringIO.new(@data, 'rb')
  @data_io.seek(@offset)
  parse
  @data_io.close
end
read_int16() click to toggle source
# File lib/android/resource.rb, line 24
def read_int16
  @data_io.read(2).unpack('v')[0]
end
read_int32() click to toggle source
# File lib/android/resource.rb, line 21
def read_int32
  @data_io.read(4).unpack('V')[0]
end
read_int8() click to toggle source
# File lib/android/resource.rb, line 27
def read_int8
  @data_io.read(1).ord
end