Java FileWriter Write saveDictionary(String fileName, Map values)

Here you can find the source of saveDictionary(String fileName, Map values)

Description

save Dictionary

License

Open Source License

Declaration

public static void saveDictionary(String fileName, Map values) throws IOException 

Method Source Code


//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();
    }
}

Related

  1. saveConfig(File conf, Map data)
  2. saveContent(String context, String filename)
  3. saveData(Map> data, File file)
  4. saveData(Map> data, String file)
  5. saveData(String fileName, double totalTime, int[] resultSubset)
  6. saveDotGraph(final String dotGraph, final File outputDirectory)
  7. saveDoubleArray2File(Double[] doubleArray, String fileName)
  8. saveDoubleArray2FileAppend(Double[] doubleArray, String fileName)
  9. saveEasyQuestImpl(final String quest, final File targetFile)