Class: SwfRuby::Swf::SwfString

Inherits:
Object
  • Object
show all
Defined in:
lib/swf_ruby/swf/swf_string.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bytearray) ⇒ SwfString

Returns a new instance of SwfString.



9
10
11
12
13
14
15
16
17
18
# File 'lib/swf_ruby/swf/swf_string.rb', line 9

def initialize(bytearray)
  @length = 0
  bytearray.each_byte do |byte|
    break if byte == 0
    @length += 1
  end
  @string = bytearray[0, @length]
  @length += 1 # Endmark
  self
end

Instance Attribute Details

#lengthObject (readonly)

including StringEndMark



7
8
9
# File 'lib/swf_ruby/swf/swf_string.rb', line 7

def length
  @length
end

#stringObject

Returns the value of attribute string.



6
7
8
# File 'lib/swf_ruby/swf/swf_string.rb', line 6

def string
  @string
end