Method: SectionStripper#patch_section

Defined in:
lib/kindlestrip.rb

#patch_section(section, _new, in_off = 0) ⇒ Object



77
78
79
80
81
82
83
84
85
# File 'lib/kindlestrip.rb', line 77

def patch_section(section, _new, in_off = 0)
  if section + 1 == @num_sections
    endoff = @data_file.length
  else
    endoff = @sections[section + 1][0]
  end
  raise unless off + in_off + _new.length <= endoff
  patch(off + in_off, _new)
end