Java FileWriter Write saveIntegerNodes2File(Integer[] nodes, String fileName)

Here you can find the source of saveIntegerNodes2File(Integer[] nodes, String fileName)

Description

save Integer nodes to the fileName

License

Open Source License

Declaration

public static void saveIntegerNodes2File(Integer[] nodes, String fileName) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    /**//from   ww  w . j  a  v a2  s. com
     * save Integer nodes to the fileName
     */
    public static void saveIntegerNodes2File(Integer[] nodes, String fileName) throws IOException {
        FileWriter fw = null;
        fw = new FileWriter(fileName);
        String str = "";
        if (nodes != null) {
            for (int i = 0; i < nodes.length; i++) {
                str = str + nodes[i];
                str = str + "\n";
            }
        } else {
            str = "null";
        }
        fw.write(str);
        fw.close();
    }
}

Related

  1. saveFlows(Map differences, String file)
  2. saveFormedClustersToFile(Vector names, Collection> clusters, String filename)
  3. saveGraph(List> graph, String sFileName)
  4. saveIndex(File root_, Hashtable index)
  5. saveInputStreamInFile(InputStream stream, FileWriter f)
  6. saveIntNodes2File(int[] nodes, String fileName)
  7. saveList(String listName, Set list)
  8. saveListStringToFile(String filePath, List listString)
  9. saveListToFile(ArrayList list, String filePath)