def replace(swf, replace_targets)
      replace_targets.sort_by { |a| a.offset }.reverse.each do |rt|
        case rt
        when Jpeg2ReplaceTarget
          swf = repl_jpeg2(swf, rt.offset, rt.jpeg)
        when Lossless2ReplaceTarget
          swf = repl_lossless2(swf, rt.offset, rt.image)
        when AsVarReplaceTarget
          swf = repl_action_push_string(swf, rt.do_action_offset, rt.offset, rt.str, rt.parent_sprite_offset)
        when SpriteReplaceTarget
          swf = repl_sprite(swf, rt.offset, rt.target_define_tags_string, rt.frame_count, rt.target_control_tags_string)
        end
      end
      swf
    end
def replace(swf, replace_targets)
      replace_targets.sort_by { |a| a.offset }.reverse.each do |rt|
        case rt
        when Jpeg2ReplaceTarget
          swf = repl_jpeg2(swf, rt.offset, rt.jpeg)
        when Lossless2ReplaceTarget
          swf = repl_lossless2(swf, rt.offset, rt.image)
        when AsVarReplaceTarget
          swf = repl_action_push_string(swf, rt.do_action_offset, rt.offset, rt.str, rt.parent_sprite_offset)
        when SpriteReplaceTarget
          swf = repl_sprite(swf, rt.offset, rt.target_define_tags_string, rt.frame_count, rt.target_control_tags_string)
        end
      end
      swf
    end
対象Swf(バイナリ)のリソースを置換.
 置換対象はReplaceTargetオブジェクトの配列で渡す.