Here you can find the source of saveDictionary(String fileName, Map values)
public static void saveDictionary(String fileName, Map values) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; import java.util.Map; public class Main { public static void saveDictionary(String fileName, Map values) throws IOException { final BufferedWriter writer = new BufferedWriter(new FileWriter(fileName)); values.entrySet().forEach(p -> { try { writer.write(p.toString()); writer.newLine();//from w w w . j a v a2 s. c o m } catch (IOException e) { e.printStackTrace(); } }); writer.flush(); writer.close(); } }