List of utility methods to do File Append Text
void | appendTextToFile(String text, File file) append Text To File try (FileOutputStream fileOutputStream = new FileOutputStream(file, true)) { fileOutputStream.write(text.getBytes()); } catch (IOException e) { throw new RuntimeException("Error while appending text to file", e); |
void | appendToFile(File destFile, InputStream source) append To File try { int chars_read = 0; BufferedReader in = new BufferedReader(new InputStreamReader(source, "GBK")); List datas = new ArrayList(); while (in.ready()) { char[] data = new char[1024]; chars_read += in.read(data, 0, 1024); datas.add(data); ... |
void | appendToFile(File file, String data) append To File FileWriter fw = new FileWriter(file, true);
fw.write(data);
fw.close();
|
void | appendToFile(File tempFile, String str) append To File BufferedOutputStream fout = null; try { fout = new BufferedOutputStream(new FileOutputStream(tempFile, true)); fout.write(str.getBytes()); } finally { if (fout != null) fout.close(); |
void | appendToFile(final File file, final String contents) Appends the contents String to a file. try (FileOutputStream fos = new FileOutputStream(file, true)) { fos.write(contents.getBytes()); |
boolean | appendToFile(final String filePath, final String textToAppend) append To File try (FileWriter fw = new FileWriter(filePath, true)) { fw.write(textToAppend); fw.close(); return true; } catch (final Exception e) { return false; |
void | appendToFile(final String text, final String urlFile) Append the specified text at the end of the File. final FileWriter fw = new FileWriter(urlFile, true); final BufferedWriter output = new BufferedWriter(fw); try { output.write(text); output.newLine(); output.flush(); } finally { output.close(); ... |
void | appendToFile(float[] in, String filename) append To File BufferedWriter outputWriter = null; outputWriter = new BufferedWriter(new FileWriter(filename)); for (int i = 0; i < in.length; i++) { outputWriter.write(Float.toString(in[i])); outputWriter.newLine(); outputWriter.flush(); outputWriter.close(); ... |
boolean | appendToFile(IFile file, String output) append To File try { if (!file.exists()) return false; InputStream source = new ByteArrayInputStream(output.getBytes()); file.appendContents(source, IFile.FORCE, null); return true; } catch (CoreException e) { e.printStackTrace(); ... |
void | appendToFile(List append To File if ((strList == null) || (strList.isEmpty()) || (file == null)) { return; BufferedWriter bw = null; try { bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true))); for (String str : strList) { bw.write(str); ... |