Java File Append appendFile(final String filename, final String content)

Here you can find the source of appendFile(final String filename, final String content)

Description

append File

License

Apache License

Declaration

public static void appendFile(final String filename, final String content) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.BufferedWriter;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

public class Main {

    public static void appendFile(final String filename, final String content) throws IOException {
        FileOutputStream output = new FileOutputStream(filename, true);
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output));
        writer.write(content);/*from ww  w .j  a v  a 2s. c  om*/
        writer.close();
        output.close();
    }
}

Related

  1. appendFile(File filename, String data)
  2. appendFile(File src, File dst)
  3. appendFile(File targetFile, String text)
  4. appendFile(File targetFile, String toWrite)
  5. appendFile(final File srcFile, final File destFile)
  6. appendFile(final String name, final String s)
  7. appendFile(OutputStream output, File source)
  8. appendFile(String content, File file)
  9. appendFile(String file, byte[]... data)