each_entry (Gem::Package::TarReader)

    # File lib/rubygems/package.rb, line 438
        def each_entry
          loop do
            return if @io.eof?
            header = TarHeader.new_from_stream(@io)
            return if header.empty?
            entry = Entry.new header, @io
            size = entry.size
            yield entry
            skip = (512 - (size % 512)) % 512
            if @io.respond_to? :seek
              # avoid reading...
              @io.seek(size - entry.bytes_read, IO::SEEK_CUR)
            else
              pending = size - entry.bytes_read
              while pending > 0
                bread = @io.read([pending, 4096].min).size
                raise UnexpectedEOF if @io.eof?
                pending -= bread
              end
            end
            @io.read(skip) # discard trailing zeros
            # make sure nobody can use #read, #getc or #rewind anymore
            entry.close
          end
        end