List of utility methods to do FileWriter Write
void | save2DArray(float[][] data, String filePath) save D Array try { FileWriter writer = new FileWriter(filePath); for (int i = 0; i < data.length; i++) { for (int j = 0; j < data[0].length; j++) { writer.write(String.format("%5.4f ", data[i][j])); writer.write("\n"); writer.close(); } catch (IOException e) { e.printStackTrace(); |
int | save2File(String fileName, String content) save File File file = new File(fileName); try { if (file.exists() == false) { file.createNewFile(); FileWriter writer = new FileWriter(fileName); writer.write(content); writer.close(); ... |
void | save_array(double[] array, String fname) savarray FileWriter f = new FileWriter(fname); BufferedWriter W = new BufferedWriter(f); for (int i = 0; i < array.length; i++) W.write(array[i] + "\n"); W.flush(); W.close(); f.close(); |
boolean | saveAllToFile(String filename, String... strings) save All To File return saveAllToFile(new File(filename), strings); |
void | saveArrayNames(int[] array, String[] names, String fname) save Array Names FileWriter f = new FileWriter(fname); BufferedWriter W = new BufferedWriter(f); for (int i = 0; i < array.length; i++) W.write(names[i] + "\t" + array[i] + "\n"); W.flush(); W.close(); f.close(); |
void | saveAuthFile(String fileName, String raw) save Auth File FileWriter f = null; try { f = new FileWriter(fileName, false); f.write(raw); f.flush(); f.close(); } catch (Exception e) { throw new RuntimeException(e); ... |
void | saveBufferInFile(String buffer, File filename) save Buffer In File BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(filename)); writer.write(buffer); } finally { if (writer != null) { writer.close(); |
void | saveCCS(Map save CCS File f = new File(file); if (!f.exists()) { f.createNewFile(); FileWriter fw = new FileWriter(f.getAbsoluteFile()); BufferedWriter bw = new BufferedWriter(fw); bw.write("expression" + "\t" + diseaseState); bw.newLine(); ... |
void | saveColumn(int[] density, String filename) save Column BufferedWriter bw = new BufferedWriter(new FileWriter(new File(filename))); for (int n : density) { bw.write(Integer.valueOf(n).toString() + "\n"); bw.close(); |
void | saveConfig(File conf, Map save Config try (BufferedWriter bw = new BufferedWriter(new FileWriter(conf))) { bw.write("#Written " + new Date().toLocaleString() + "\n"); for (Entry<String, String> e : data.entrySet()) { bw.write(e.getKey() + "=" + e.getValue() + "\n"); } catch (IOException ex) { ex.printStackTrace(); |