Write LinkedHashMap to a text file?
<p>How do you read/write a Map, specifically a LinkedHashMap, from/to a text file? I've tried to use the Iterable interface, but that doesn't work because i have Map and Iterable can only take one argument. </p>

<p>Map code:</p>

<pre><code>Map&lt;String, String&gt; m1 = new LinkedHashMap&lt;String, String&gt;(16, 0.75f, true);

m1.put("John Smith", "555-555-5555");
m1.put("Jane Smith", "444-444-4444");
</code></pre>

<p>I know I have to create a PrintWriter + BufferedWriter/PrintReader + BufferedReader objects to read/write to this text file, and then use some version of the hasNext() method to read until the file ends, I just am not sure how. Please help!</p>

<p>EDIT: I can't use the Serializable interface for this either, because I'm trying to write a Map to the text file, not individual entries, and there's no indexOf() method for Maps. </p>