# File lib/rubygems/source_info_cache.rb, line 66
  def cache_data
    return @cache_data if @cache_data
    cache_file # HACK writable check

    begin
      # Marshal loads 30-40% faster from a String, and 2MB on 20061116 is small
      data = File.open cache_file, 'rb' do |fp| fp.read end
      if data.length <= 4 then
        raise ArgumentError, "Data too small"
      end
      @cache_data = Marshal.load data

      @cache_data.each do |url, sice|
        next unless sice.is_a?(Hash)
        update
        cache = sice['cache']
        size  = sice['size']
        if cache.is_a?(Gem::SourceIndex) and size.is_a?(Numeric) then
          new_sice = Gem::SourceInfoCacheEntry.new cache, size
          @cache_data[url] = new_sice
        else # irreperable, force refetch.
          reset_cache_for(url)
        end
      end
      @cache_data
    rescue => ex
      if Gem.configuration.really_verbose then
        say "Exception during cache_data handling: #{ex.class} - #{ex}"
        say "Cache file was: #{cache_file}"
        say "\t#{ex.backtrace.join "\n\t"}"
      end
      reset_cache_data
    end
  end