title: TarWriter throws Gem::Package::TarWriter::FileOverflow
body: <p>I want to generate a tar from a buch of files.</p>
  
  <pre><code>out_file = File.new('some.tar', 'w')
  tar = Gem::Package::TarWriter.new out_file
  attachments = #Array of attachment objects
  attachments.each{|a|
     file = Attachment.new(a).read_file #returns a String
     file.force_encoding('UTF-8')
     tar.add_file_simple( a[:filename], 777, file.length) do |io|
        io.write(file)
      end
  }
  </code></pre>
  
  <blockquote>
    <p>Gem::Package::TarWriter::FileOverflow - You tried to feed more data
    than fits in the file.</p>
  </blockquote>
  
  <p>Has anyone an idea why this happens and how to fix it?</p>