title: Java: saving and reading hashmaps from file
body: <p>I have the following nested hashmap:</p>
  
  <pre><code>HashMap&lt;Foo1, HashMap&lt;Foo2, TObjectDoubleHashMap&lt;Foo1&gt;&gt;&gt; my_map;
  </code></pre>
  
  <p>There are over a million entries in the <code>TObjectDoubleHashmap</code> and takes about a minute to generate.  What are my options to save it to file so it won't need to be generated every time?</p>
  
  <p>So far I've saved the actual keys and values to a text file then load it into the hashmap again, but that is not saving that much time.  Is there a faster way such as saving it as an object using serialization?  If so, what do I have to do to make my keys serializable?</p>