Here you can find the source of saveFlows(Map
public static void saveFlows(Map<String, Double> differences, String file) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.Map; public class Main { public static void saveFlows(Map<String, Double> differences, String file) throws IOException { try {/*from w w w . ja v a 2 s . c o m*/ File f = new File(file); if (!f.exists()) { f.createNewFile(); } FileWriter fw = new FileWriter(f.getAbsoluteFile()); BufferedWriter bw = new BufferedWriter(fw); bw.write("gene\tflows"); bw.newLine(); for (String gene : differences.keySet()) { bw.write(gene + "\t" + differences.get(gene)); bw.newLine(); } bw.close(); } catch (IOException e) { throw new IOException("Error creating or writing " + file, e); } } }