The list of methods to do File Append are organized into topic(s).
void
appendContent(File file, String content, String encoding) Append text content to file, with encoding.
Writer writer = null;
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true), encoding));
writer.append(content);
} finally {
if (writer != null) {
writer.flush();
writer.close();
...
void
appendFile(File f, String content) append File
BufferedWriter writer = null;
try {
writer = new BufferedWriter(new FileWriter(f, true));
writer.write(content);
} catch (Exception e) {
throw e;
} finally {
if (writer != null) {
...
void
appendFile(File f, StringBuffer sb) append File
try {
BufferedReader br = new BufferedReader(new FileReader(f));
char[] buffer = new char[1000];
int c = 0;
while ((c = br.read(buffer)) > 0) {
sb.append(buffer, 0, c);
} catch (IOException e) {
...
void
appendFile(File file, String content) Write some text into the end of a file (append)
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter(file, true));
bw.write(content);
bw.flush();
} catch (FileNotFoundException e) {
if (bw != null)
bw.close();
...
void
appendFile(File file, String url) append File
FileWriter fw;
try {
fw = new FileWriter(file, true);
fw.write(url);
fw.close();
} catch (IOException e) {
e.printStackTrace();