List of utility methods to do BufferedWriter Write
void | writeFile(String filename, Map Create a new file and write the contents to it File file = new File(filename); BufferedWriter bw = null; Iterator<String> it = map.keySet().iterator(); try { file = new File(filename); if (!file.exists()) { file.createNewFile(); FileWriter fw = new FileWriter(file.getAbsoluteFile()); bw = new BufferedWriter(fw); while (it.hasNext()) { bw.write(map.get(it.next())); bw.write("\n"); } catch (IOException e) { e.printStackTrace(); } finally { try { bw.close(); } catch (IOException e) { e.printStackTrace(); |
void | writeFile(String line, File file) write File writeFile(Arrays.asList(new String[] { line }), file);
|
void | writefile(String m, String path) writefile try { File file = new File(path); if (!file.exists()) { file.createNewFile(); FileWriter fileWritter = new FileWriter(file.getName(), true); BufferedWriter bufferWritter = new BufferedWriter(fileWritter); bufferWritter.write(m); ... |
void | writeFile(String outputLocation, String fileName, List write File try { boolean addLine = true; if (!(new File(outputLocation.concat(fileName)).exists())) { addLine = false; FileWriter fw = new FileWriter(outputLocation.concat(fileName), true); BufferedWriter bw = new BufferedWriter(fw); int count = 0; ... |
void | writeFile(String p_name, String p_encoding, String p_content) write File BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(p_name), p_encoding)); out.write(p_content); out.close(); |
boolean | writeFileAppend(String filePath, String content) write File Append boolean res = true; BufferedWriter out = null; try { out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filePath, true), "UTF-8")); out.write(content); } catch (Exception e) { res = false; try { out.close(); } catch (IOException e) { return res; |
void | writeFileContent(File audioFile, short[] data, boolean littleEndian) write short array as byte file. try { DataOutputStream out = new DataOutputStream(new FileOutputStream(audioFile)); byte hb, lb; if (littleEndian) { for (int i = 0; i < data.length; i++) { lb = (byte) data[i]; hb = (byte) (data[i] >> 8); out.write(lb); ... |
void | writeFileContents(File file, String contents) Writes the contents of a string to a file. BufferedWriter writer = new BufferedWriter(new FileWriter(file)); writer.write(contents); writer.close(); |
void | writeFilenames(String folderPath, LinkedList write Filenames FileWriter filesFile = new FileWriter(folderPath + System.getProperty("file.separator") + "files.csv"); BufferedWriter outFiles = new BufferedWriter(filesFile); outFiles.write("Filenames"); outFiles.newLine(); for (int i = 0; i < listOfPopulationFiles.size(); i++) { outFiles.write(listOfPopulationFiles.get(i).getName().substring(0, listOfPopulationFiles.get(i).getName().length() - 4)); outFiles.newLine(); ... |
void | writeFileText(File file, String text) Writes the text data to the specified output file. OutputStream out = new FileOutputStream(file);
writeLinesCommon(out, text);
|