Java File Append Text appendToFile(File tempFile, String str)

Here you can find the source of appendToFile(File tempFile, String str)

Description

append To File

License

Open Source License

Declaration

public static void appendToFile(File tempFile, String str) throws IOException 

Method Source Code


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

import java.io.*;

public class Main {
    public static void appendToFile(File tempFile, String str) throws IOException {
        BufferedOutputStream fout = null;
        try {//  w w  w  .  j  ava2s  .com
            fout = new BufferedOutputStream(new FileOutputStream(tempFile, true));
            fout.write(str.getBytes());
        } finally {
            if (fout != null)
                fout.close();
        }
    }
}

Related

  1. appendTextToFile(String filename, String data)
  2. AppendTextToFile(String filePath, String text)
  3. appendTextToFile(String text, File file)
  4. appendToFile(File destFile, InputStream source)
  5. appendToFile(File file, String data)
  6. appendToFile(final File file, final String contents)
  7. appendToFile(final String filePath, final String textToAppend)
  8. appendToFile(final String text, final String urlFile)
  9. appendToFile(float[] in, String filename)